Two Pointer | sorting | python | O(nlogn)
 # Intuition  \n\n\n# Approach\nTwo Pointer\n\n\n# Complexity\n- Time complexity:O(nlogn)\n\n\n- Space complexity:O(N)\n\n\n# Code\n\nclass Solution:\n    def c
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nTwo Pointer\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(N)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def countExcellentPairs(self, nums: List[int], k: int) -> int:\n        nums = set(nums)\n        arr = [bin(x).count(\'1\') for x in nums]\n        arr.sort()\n        ans = 0\n        l,h = 0,len(nums) - 1\n        while l < h:\n            if arr[l] + arr[h] >= k:\n                ans += (h - l) * 2 + 1\n                h -= 1\n            else:\n                l += 1\n        if arr[l]*2 >= k:ans += 1\n        return ans\n\n```
['Two Pointers', 'Sorting', 'Python3']