Short || Clean || Priority Queue ||Java
\njava []\nclass Solution {\n    public int maximizeGreatness(int[] nums) {\n        PriorityQueue<Integer> pq1 = new PriorityQueue();\n        PriorityQueue<In
\n```java []\nclass Solution {\n    public int maximizeGreatness(int[] nums) {\n        PriorityQueue<Integer> pq1 = new PriorityQueue();\n        PriorityQueue<Integer> pq2 = new PriorityQueue();\n        for(int i: nums){\n            pq1.add(i);\n            pq2.add(i);\n        }\n        int count = 0;\n        while(!pq2.isEmpty()){\n            if(pq1.peek() < pq2.peek()){\n                pq1.poll();\n                count++;\n            }\n            pq2.poll();\n        }\n        return count;\n    }\n}\n```
['Java']