You are viewing a single comment's thread. Return to all comments →
Python3:
def birthday(s, d, m): res = 0 if len(s) < m: return res for i in range(len(s)): if(sum(s[i : i+m])==d): res+=1 return res
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division 1
You are viewing a single comment's thread. Return to all comments →
Python3:
def birthday(s, d, m): res = 0 if len(s) < m: return res for i in range(len(s)): if(sum(s[i : i+m])==d): res+=1 return res