<doocs>0219.Contains Duplicate II_1.py
def containsNearbyDuplicate( nums: List[int], k: int) -> bool:
    mp = {}
    for i, v in enumerate(nums):
        if v in mp and i - mp[v] <= k:
            return True
        mp[v] = i
    return False
def sample_funcname ( var_0 : List [ int ] , var_3 : int ) -> bool :
    var_5 = { }
    for var_7 , var_8 in enumerate ( var_0 ) :
        if var_8 in var_5 and var_7 - var_5 [ var_8 ] <= var_3 :
            return True
        var_5 [ var_8 ] = var_7
    return False
