Longest Repeating Character Replacement
Examples
Example 1:
Input: s = "XYYX", k = 2
Output: 4
Explanation:
Example 2:
Input: s = "AAABABB", k = 1
Output: 5
Example 1:
Input: s = "XYYX", k = 2
Output: 4
Explanation:
Example 2:
Input: s = "AAABABB", k = 1
Output: 5
You are given a string s consisting of only uppercase english characters and an integer k. You can choose up to k characters of the string and replace them with any other uppercase English character.
After performing at most k replacements, return the length of the longest substring which contains only one distinct character.
Either replace the 'X's with 'Y's, or replace the 'Y's with 'X's.
1 <= s.length <= 10000 <= k <= s.length