You are viewing a single comment's thread. Return to all comments →
//javascript function birthday(s, d, m) { // Write your code here
let contador = 0;
for (let i = 0; i <= s.length - m; i++) {
const bloque = s.slice(i, i + m); const suma = bloque.reduce((acumulador, valorActual) => acumulador + valorActual, 0); if (suma === d) { contador++; }
}
return contador;
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 function birthday(s, d, m) { // Write your code here
for (let i = 0; i <= s.length - m; i++) {
}
return contador;
}