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


This is an example of scrolling text using Javascript.

Popular Posts