Super Easy Pyhton Solution
Time Complexity: O(n log n)\nSpace complexity: O(n)\n\nPseudocode\n1. Sort nums\n2. Using two pointers, if the right pointer is greater than the left then count
Time Complexity: ***O(n log n)***\nSpace complexity: ***O(n)***\n\nPseudocode\n1. Sort `nums`\n2. Using two pointers, if the right pointer is greater than the left then count that and increment both pointers. \n3. Else increment only right pointer\n\nCode:\n```\nclass Solution:\n    def maximizeGreatness(self, nums: List[int]) -> int:\n        l=0\n        r=0\n        ans = 0\n        nums.sort()\n        while r < len(nums):\n            if nums[r] > nums[l]:\n                l+=1\n                ans+=1\n            r+=1\n        return ans\n```\n\n
['Sorting', 'Python', 'Python3']