We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
let reducer = (a, c) => a + c;
let count=0;
for(let i=0; i<s.length; i++){
let temp = s.slice(i, m+i);
if(temp.reduce(reducer) == d){
count++;
}
}
return count;
in JS
Subarray Division
You are viewing a single comment's thread. Return to all comments →
function birthday(s, d, m) {