C# || Count
\n    public long CountExcellentPairs(int[] nums, int k)\n    {\n        long[] count = new long[30];\n        foreach (int num in nums.Distinct())\n        {\n
```\n    public long CountExcellentPairs(int[] nums, int k)\n    {\n        long[] count = new long[30];\n        foreach (int num in nums.Distinct())\n        {\n            int onesCount = Convert.ToString(num, 2).Count(a => a == \'1\');\n            count[onesCount]++;\n        }\n\n        long result = 0;\n        for (int i = 1; i < 30; ++i)\n            for (int j = 1; j < 30; ++j)\n                if (i + j >= k)\n                    result += count[i] * count[j];\n        return result;\n    }\n```
[]