Count Substrings That Satisfy K-Constraint I
Slide a window that never holds more than k zeros or more than k ones, and count the valid ends for each right edge.
Slide a window that never holds more than k zeros or more than k ones, and count the valid ends for each right edge.