Longest repeating character substring
Your task
You are given a string s of uppercase English letters and an integer k. You may replace at most k characters in s with any uppercase letter. Return the length of the longest substring that can be made to consist of a single repeated letter after performing at most k replacements. Here 1 <= len(s) <= 10^5 and 0 <= k <= len(s).
Examples
character_replacement(s: str, k: int) -> intExample 1
Input
character_replacement("ABAB", 2)Output
4