<qiyuangong>868_Binary_Gap_2.py
def binaryGap( n: int) -> int:
    res = 0
    last = -1
    
    for i, curr in enumerate(bin(n)[2:]):
        if curr == '1':
            if last >= 0:
                res = max(res, i - last)
            last = i
    return res
def sample_funcname ( var_0 : int ) -> int :
    var_3 = 0
    var_5 = - 1
    for var_7 , var_10 in enumerate ( bin ( var_0 ) [ 2 : ] ) :
        if var_10 == '1' :
            if var_5 >= 0 :
                var_3 = max ( var_3 , var_7 - var_5 )
            var_5 = var_7
    return var_3
