You are given an uppercase English string s and an integer k. You can choose any character in the string and replace it with any other uppercase English letter, at most k times.
Return the length of the longest substring containing the same letter you can obtain after performing at most k replacements.
Input / output
s: string, k: intint — maximum length of a valid repeating-character substring1 <= s.length <= 10^5s consists of only uppercase English letters (A–Z)0 <= k <= s.lengthWhy don't we need to recompute the exact maximum frequency in the window when shrinking from the left?