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.
deftestResult(result,d):count=0forxyinresult:temp=0forrecordinxy:temp+=recordiftemp==d:count+=1returncountdefpushMRecord(idx,m,s):res=[]foridxsinrange(m):ifidx+idxs<len(s):res.append(s[idx+idxs])returnresdefbirthday(s,d,m):# Write your code heretemp=[]result=[]print(len(s),"sds")print(d,"sdac")iflen(s)==d:return1foridxinrange(len(s)):ifidx==len(s)-m+1:continuetemp=pushMRecord(idx,m,s)print("Tem",temp)iflen(temp)==m:result.append(temp)temp=[]print(result)testRes=testResult(result,d)returntestRes
Cookie support is required to access HackerRank
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 →
logic on python