PythiloMedium · 25 min · Task 51 of 100 · progress kept in this browser

Longest window after flips

Return the longest binary subarray containing at most k zeros, where k is nonnegative.

window = [1, 0, 1, 0]
k = 1
print(window.count(0) > k)  # shrink left
Your task

Return the longest binary subarray containing at most k zeros, where k is nonnegative.