':type nums: List[int]
:type k: int
:rtype: int'

def findPairs(self, nums, k):

    if (k < 0):
        return 0
    (result, lookup) = (set(), set())
    for num in nums:
        if ((num - k) in lookup):
            result.add((num - k))
        if ((num + k) in lookup):
            result.add(num)
        lookup.add(num)
    return len(result)
