<doocs>0424.Longest Repeating Character Replacement_1.py
def characterReplacement( s: str, k: int) -> int:
    counter = [0] * 26
    i = j = maxCnt = 0
    while i < len(s):
        counter[ord(s[i]) - ord('A')] += 1
        maxCnt = max(maxCnt, counter[ord(s[i]) - ord('A')])
        if i - j + 1 > maxCnt + k:
            counter[ord(s[j]) - ord('A')] -= 1
            j += 1
        i += 1
    return i - j
def sample_funcname ( var_0 : str , var_2 : int ) -> int :
    var_6 = [ 0 ] * 26
    var_9 = var_7 = var_8 = 0
    while var_9 < len ( var_0 ) :
        var_6 [ ord ( var_0 [ var_9 ] ) - ord ( 'A' ) ] += 1
        var_8 = max ( var_8 , var_6 [ ord ( var_0 [ var_9 ] ) - ord ( 'A' ) ] )
        if var_9 - var_7 + 1 > var_8 + var_2 :
            var_6 [ ord ( var_0 [ var_7 ] ) - ord ( 'A' ) ] -= 1
            var_7 += 1
        var_9 += 1
    return var_9 - var_7
