✅ Swift: Easy to Understand and Simple Solution
\n\n# Code\n\nclass Solution {\n    func maximizeGreatness(_ nums: [Int]) -> Int {\n        var nums = nums.sorted()\n        var res = 0\n        \n        for
\n\n# Code\n```\nclass Solution {\n    func maximizeGreatness(_ nums: [Int]) -> Int {\n        var nums = nums.sorted()\n        var res = 0\n        \n        for num in nums{\n            if num > nums[res] {res += 1}\n        }\n        \n        return res\n    }\n}\n```
['Swift']