• + 0 comments

    I guess it is the simplest to understand m is the length of vector d is the sum of consecutive no.

    int birthday(vector<int> s, int d, int m) {
        int req=0;
        for(int i=0;i<s.size()-m+1;i++){
            int count=0;
            
            for(int j=0;j<m;j++){
                count+=s[i+j];
            }if(count==d){
                req++;
            }
        }return req;
    }