Java Simplest Easiest Priority Queue
\nclass Solution {\n    public int lastStoneWeight(int[] stones) {\n        PriorityQueue<Integer> queue = new PriorityQueue<Integer>(Collections.reverseOrder()
```\nclass Solution {\n    public int lastStoneWeight(int[] stones) {\n        PriorityQueue<Integer> queue = new PriorityQueue<Integer>(Collections.reverseOrder());\n        for (int s : stones) {\n            queue.add(s);\n        }\n        while (queue.size() > 1) {\n            int weight1 = queue.poll();\n            int weight2 = queue.poll();\n            queue.add(weight1 - weight2);\n        }\n        return queue.size() == 0? 0 : queue.poll();\n    }\n}\n```
['Java']