You are viewing a single comment's thread. Return to all comments →
Sliding window approach using JavaScript
function birthday(s, d, m) { let count = 0; for (let i=0; i<s.length; i++){ let sum = 0; for (let j=0; j<m; j++){ sum = sum+s[i+j]; } if (sum == d){ count++; } } return count; }
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division 1
You are viewing a single comment's thread. Return to all comments →
Sliding window approach using JavaScript