You are viewing a single comment's thread. Return to all comments →
**Javascript Solution: **
function birthday(s, d, m) { let total = 0; if(s.length == 1 && s[0] == d) return 1; for(let i =0; i < s.length -1; i++) { if(s.slice(i,i+m).reduce((a,b) => a+b) == d) total++; } return total; }
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 →
**Javascript Solution: **