Sum of set bits
Code
# Code
```cpp []
#define li long long
class Solution {
public:
    long long countExcellentPairs(vector<int>& a, int k) {
        li n = a.size();
        vector<li> count(64, 0);
        map<li, li> mpp;
        for (li i = 0; i < n; i++) {
            mpp[a[i]]++;
            if (mpp[a[i]] >= 2)
                continue;
            li r = __builtin_popcount(a[i]);
            count[r]++;
        }
        li ans = 0;
        for (li i = 0; i < 64; i++)
            for (li j = 0; j < 64; j++)
                if (i + j >= k && count[i] > 0 && count[j] > 0)
                    ans += count[i] * count[j];
        return ans;
    }
};
```
['C++']