You are viewing a single comment's thread. Return to all comments →
Did similarly, but shorter
def solve(n, s, d, m): return sum([1 for i in range(n-m+1) if sum(s[i:i+m]) == d])
Subarray Division
You are viewing a single comment's thread. Return to all comments →
Did similarly, but shorter