<doocs>1004.Max Consecutive Ones III_1.py
def longestOnes( nums: List[int], k: int) -> int:
    l = r = -1
    while r < len(nums) - 1:
        r += 1
        if nums[r] == 0:
            k -= 1
        if k < 0:
            l += 1
            if nums[l] == 0:
                k += 1
    return r - l
def sample_funcname ( var_0 : List [ int ] , var_3 : int ) -> int :
    var_6 = var_4 = - 1
    while var_4 < len ( var_0 ) - 1 :
        var_4 += 1
        if var_0 [ var_4 ] == 0 :
            var_3 -= 1
        if var_3 < 0 :
            var_6 += 1
            if var_0 [ var_6 ] == 0 :
                var_3 += 1
    return var_4 - var_6
