Problems > Ones with K Flips > Editorial

Ones with K Flips — Solution & Editorial

Back to the Problem

Sliding window keeping at most K zeros inside: expand right, shrink left when the zero count overflows.

Complexity: O(N)