Questions and Answers
Problems and Solutions
Quotes help make search much faster. Example: "Practice Makes Perfect"
Thursday, December 15, 2016
Codefights countSumOfTwoRepresentations2(n,l,r)
//sample solution
function countSumOfTwoRepresentations2(n, l, r) {
var count=0;
for(i=1;i<n;i++){
var diff = n - i;
if(i>=l && diff<=r && i<=diff){
count++;
}
}
return count;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
This is an example of
scrolling text
using Javascript.
Popular Posts
No comments:
Post a Comment