• + 0 comments

    I'm really proud of mine(don't know how to optimize it though): int birthday(vector s, int d, int m) { int n = s.size(); int crit = 0;

    for (int i = 0; i <= n - m; i++) {
        int sum = 0;  
    
    
        for (int j = i; j < i + m; j++) {
            sum += s[j];
        }
    
    
        if (sum == d) {
            crit++;
        }
    }
    
    return crit;
    

    }

    return crit;
    

    }