You are viewing a single comment's thread. Return to all comments →
The shortest method for the above python code
return sum(1 for x in range(len(s)) if sum(s[x:x+m]) == d)
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division
You are viewing a single comment's thread. Return to all comments →
The shortest method for the above python code
return sum(1 for x in range(len(s)) if sum(s[x:x+m]) == d)