[Python3] Runtime: 58 ms, faster than 99.40% | Memory: 15.6 MB, less than 89.25%
\nclass Solution:\n\tdef findPairs(self, nums: List[int], k: int) -> int:\n\t\tans,check = 0,{}\n\t\tfor i in nums:\n\t\t\tif i not in check:\n\t\t\t\tcheck[i]=
```\nclass Solution:\n\tdef findPairs(self, nums: List[int], k: int) -> int:\n\t\tans,check = 0,{}\n\t\tfor i in nums:\n\t\t\tif i not in check:\n\t\t\t\tcheck[i]=1\n\t\t\telse:\n\t\t\t\tcheck[i]+=1\n\t\tif k>0:\n\t\t\tfor j in check:\n\t\t\t\tif j+k in check.keys():\n\t\t\t\t\tans+=1\n\t\telse:\n\t\t\tfor j in check:\n\t\t\t\tif check[j]>1:\n\t\t\t\t\tans+=1\n\t\treturn ans\n```
['Python']