Return the length of the longest substring containing the same letter you can obtain after performing at most k replacements.
Example 1:
Input: s = "ABAB", k = 2
Output: 4
Explanation: We can replace the two 'A' characters with 'B' or the two 'B' characters with 'A'. The entire string becomes a repeating-character substring of length: 4
Example 2:
Input: s = "AABABBA", k = 1
Output: 4
Explanation: One possible transformation is: "AABBBBA". The substring: "BBBB" has length: 4
Example 3:
Input: s = "AAAA", k = 2
Output: 4
Explanation: The string already contains repeating characters, so no replacement is required.