<garvit244>1004_1.py
def longestOnes( A, K):
    start_index = 0
    for end_index in range(0, len(A)):
        K -= 1-A[end_index]
        if K < 0:
            K += 1-A[start_index]
            start_index += 1
    return end_index-start_index+1
def sample_funcname ( var_0 , var_1 ) :
    var_3 = 0
    for var_6 in range ( 0 , len ( var_0 ) ) :
        var_1 -= 1 - var_0 [ var_6 ]
        if var_1 < 0 :
            var_1 += 1 - var_0 [ var_3 ]
            var_3 += 1
    return var_6 - var_3 + 1
