Easy Java Solution
\nclass Solution {\n    public int maximizeGreatness(int[] nums) {\n        Arrays.sort(nums);\n        if(nums.length==1)\n            return 0;\n        int c
```\nclass Solution {\n    public int maximizeGreatness(int[] nums) {\n        Arrays.sort(nums);\n        if(nums.length==1)\n            return 0;\n        int count=0;\n        for(int i=1;i<nums.length;i++){\n            if(nums[i]>nums[count])\n                count++;\n        }\n        return count;\n    }\n}\n```
['Java']