Minimum Number of K Consecutive Bit Flips
Scan left to right and flip a window of k bits exactly when the leftmost bit is still 0; track the active flips with a parity.
Scan left to right and flip a window of k bits exactly when the leftmost bit is still 0; track the active flips with a parity.