Longest Repeating Character Replacement — sliding window
Grow the right edge. If the window would need more than k replacements, slide the left edge once. The window never shrinks.
Try:
window size = 0 max_freq (high-water) = 0 check: size − max_freq = 0 / k
character counts in the window