Longest repeating character substring

Write codeMedium25 minMeta style

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) -> int
Example 1
Inputcharacter_replacement("ABAB", 2)
Output4