Longest Repeating Character Replacement
MediumLeetCodeSliding Window
Approach hintTry it first, then revealHide
A window is valid when its length minus the count of its most frequent letter is at most k. Grow the right end and move the left end forward whenever the window becomes invalid.