You are viewing a single comment's thread. Return to all comments →
Hey I made this version of sliding windows in Python3... with O(n):
def birthday(arr, d, m): count = 0 currentSum = 0 for i in range(0, len(arr)): currentSum += arr[i] if i >= m-1: if currentSum == d: count += 1 currentSum -= arr[i-(m-1)] return count
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 →
Hey I made this version of sliding windows in Python3... with O(n):