<qiyuangong>219_Contains_Duplicate_II_2.py
def containsNearbyDuplicate( nums, k):
    check = set()
    for i in range(len(nums)):
        if i > k:
            check.remove(nums[i - k - 1])
        if nums[i] in check:
            return True
        else:
            check.add(nums[i])
    return False
def sample_funcname ( var_0 , var_1 ) :
    var_3 = set ( )
    for var_6 in range ( len ( var_0 ) ) :
        if var_6 > var_1 :
            var_3.remove ( var_0 [ var_6 - var_1 - 1 ] )
        if var_0 [ var_6 ] in var_3 :
            return True
        else :
            var_3.add ( var_0 [ var_6 ] )
    return False
