Sort and Bisect Easy solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    def maximizeGreatness(self, nums: List[int]) -> int:\n        sorted_nums = sorted(nums)\n        count = 0\n        for num in nums:\n            idx = bisect_right(sorted_nums, num)\n            if  idx < len(sorted_nums):\n                sorted_nums.pop(idx)\n        return(len(nums) - len(sorted_nums))\n        \n```
['Python3']