very simple || c++ || easy to understand
Code\n\nclass Solution {\npublic:\n    long long countExcellentPairs(vector<int>& nums, int k) {\n        unordered_set<int> s;\n        for(auto &i: nums)s.ins
# Code\n```\nclass Solution {\npublic:\n    long long countExcellentPairs(vector<int>& nums, int k) {\n        unordered_set<int> s;\n        for(auto &i: nums)s.insert(i);\n        vector<int> v(32,0);\n        int x = 0;\n        for(auto i: s){\n            x = 0;\n            while(i){\n                x += (i&1);\n                i >>= 1;\n            }\n            v[x]++;\n        }\n        long long int ans = 0;\n        int i,j;\n        for(i = 0; i < 32; i++){\n            for(j = 0; j < 32; j++){\n                if(i+j>=k)\n                    ans += v[i]*1LL*v[j];\n            }\n        }\n        return ans;\n    }\n};\n```
['Array', 'Hash Table', 'Bit Manipulation', 'Ordered Set', 'C++']