1//subdivision Array
2function birthday(s, d, m) {
3 let count = 0
4 const length = s.length - m
5 for(let i=0;i<=length;i++) {
6 if(s.slice(i,i+m).reduce((a,b) => a+b)=== d) {
7 count++
8 }
9 }
10 console.log(count)
11}
12birthday([1,2,1,3,2],3,2)
13