• + 1 comment

    def birthday(s, d, m):

    # Write your code here
    sum=0
    count=0
    for i in range(0,m):
        sum+=s[i]
    if(sum==d):
        count+=1
    for i in range(m,len(s)):
        sum+=s[i]
        sum-=s[i-m]
        if(sum==d):
            count+=1
    return count