Given a string s and an integer k, you can choose any character of the string and change it to any other uppercase English letter. You can perform this operation at most k times.
Return the length of the longest substring containing the same letter you can get after performing the above operations.
Example 1:
Input: s = "ABAB", k = 2
Output: 4
Explanation: Replace the two A's with B's (or the two B's with A's) to get a substring of 4 identical characters.
Example 2:
Input: s = "AABABBA", k = 1
Output: 4
Explanation: Replace the B at index 3 with A to get "AAAAABA", giving the substring "AAAA" of length 4.
Example 3:
Input: s = "ABBB", k = 2
Output: 4
Explanation: Replace the A at index 0 with B to get "BBBB". Only 1 change is needed, which is within the allowed k = 2.
1 <= s.length <= 10⁵s consists of only uppercase English letters.0 <= k <= s.length