Questions are not hard, Just tricky...and when you get stuck try to observe pattern.
\nclass Solution:\n    def countExcellentPairs(self, nums: List[int], k: int) -> int:\n        nums=list(set(nums))\n        for i in range(len(nums)):\n       
```\nclass Solution:\n    def countExcellentPairs(self, nums: List[int], k: int) -> int:\n        nums=list(set(nums))\n        for i in range(len(nums)):\n            b=bin(nums[i])\n            nums[i]=b.count("1")\n        nums.sort()\n        count=0\n        \n        left=0\n        right=len(nums)-1\n       \n        while(left<=right and right>=0):\n            if nums[left]+nums[right]>=k:\n                    count=count + (right-left)*2 +1\n                    right-=1\n            else:\n                left+=1\n        return count\n```
['Sorting', 'Python']