c++ || O(n) - hashing
```\nclass Solution {\npublic:\n    int findPairs(vector& nums, int k) {\n        \n        unordered_map hash;\n        for(int i=0;i1) \n                    c
```\nclass Solution {\npublic:\n    int findPairs(vector<int>& nums, int k) {\n        \n        unordered_map<int,int> hash;\n        for(int i=0;i<nums.size();i++) hash[nums[i]]++;\n        \n        int count =0; \n        \n        for(auto i: hash){\n            if(k==0) {\n                if(i.second>1) \n                    count++;\n            }\n            \n             else {\n                 if (hash.find(i.first - k) != hash.end()) \n                     count++;\n             }\n        }\n        \n        return count;\n        \n    }\n};\n
['C', 'C++']