You are viewing a single comment's thread. Return to all comments →
Ours are pretty close!
function getWays(squares, total, window){ total = parseInt(total); window = parseInt(window); var solutions = 0; for (var i=0;i<=(squares.length)-window;i++){ var sum=0; for (var x=0;x<window;x++){ sum+=squares[i+x]; } if(sum==total){ solutions++; } } console.log(solutions); }
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division
You are viewing a single comment's thread. Return to all comments →
Ours are pretty close!