You are viewing a single comment's thread. Return to all comments →
You could optimise it a bit as there is no need to go fully to the end of the array each time
for (var i = 0; i <= n-m; i++) { if (reduce(s.slice(i, i + m)) === d) count++; }
Subarray Division
You are viewing a single comment's thread. Return to all comments →
You could optimise it a bit as there is no need to go fully to the end of the array each time