c# PriorityQueue .NET6
Use c# PriorityQueue\n\n\npublic class Solution {\n    public int LastStoneWeight(int[] stones) {\n        PriorityQueue<int, int> queue = new();\n        forea
Use c# PriorityQueue\n\n```\npublic class Solution {\n    public int LastStoneWeight(int[] stones) {\n        PriorityQueue<int, int> queue = new();\n        foreach(int s in stones)\n        {\n            queue.Enqueue(s,-s);\n        }\n        while(queue.Count >1)\n        {\n            int stone1 = queue.Dequeue();\n            int stone2 = queue.Dequeue();\n            if(stone1 != stone2)\n            {\n                int newStone = stone1 - stone2;\n                newStone = newStone > 0 ? newStone : newStone * -1;\n                queue.Enqueue(newStone, -newStone);\n            }\n        }\n        if(queue.Count ==0)\n        {\n            return 0;\n        }\n        return queue.Dequeue();\n    }\n}\n```
['Heap (Priority Queue)']