Python 7-line Super Simple and Short Solution
\nclass Solution:\n    def findPairs(self, nums: List[int], k: int) -> int:\n        if (k == 0):\n            return len([item for item, count in collections.C
```\nclass Solution:\n    def findPairs(self, nums: List[int], k: int) -> int:\n        if (k == 0):\n            return len([item for item, count in collections.Counter(nums).items() if count > 1])\n        \n        nums = set(nums)\n        res = 0\n        for n in nums:\n            res += 1 if n-k in nums else 0\n        return res\n```\n**Like it? please upvote...**
['Python']