Best Approach || Easy solution || easy-understanding
\n//Please upvote,if u like it :)\nint findPairs(vector<int>& nums, int k){\n        unordered_map<int,int> mp;\n        for(auto it:nums){\n            mp[it]+
```\n//Please upvote,if u like it :)\nint findPairs(vector<int>& nums, int k){\n        unordered_map<int,int> mp;\n        for(auto it:nums){\n            mp[it]++;\n        }\n        int ans = 0;\n        for(auto it:mp){\n            int findd = it.first + k;\n            if(mp.find(findd) != mp.end()){\n                if(findd == it.first && mp[findd] > 1){\n                    ans++;\n                }else if(findd != it.first){\n                    ans++;\n                }\n            }\n        }\n        return ans;\n    }\n//Please upvote,if u like it :)\n```
['C', 'Ordered Set', 'Python', 'C++', 'Java']