We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
# 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
Subarray Division
You are viewing a single comment's thread. Return to all comments →
def birthday(s, d, m):