You are viewing a single comment's thread. Return to all comments →
In Python True == 1 and False == 0, so this also works:
def solve(n, s, d, m): return sum(sum(s[i: i + m]) == d for i in range(n - m + 1))
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 →
In Python True == 1 and False == 0, so this also works: