C# simple solution with PriorityQueue
Code\n\npublic class Solution {\n    public int LastStoneWeight(int[] stones) {\n\n        var heap = new PriorityQueue<int, int>();\n        \n        foreach 
# Code\n```\npublic class Solution {\n    public int LastStoneWeight(int[] stones) {\n\n        var heap = new PriorityQueue<int, int>();\n        \n        foreach (var stone in stones)\n            heap.Enqueue(stone, 0 - stone);\n\n        while (heap.Count > 1)\n        {\n            var newStone = heap.Dequeue() - heap.Dequeue();\n            if (newStone > 0)\n                heap.Enqueue(newStone, 0 - newStone);\n        }\n        \n        return heap.Count > 0 ? heap.Dequeue() : 0;\n    }\n}\n```
['C#']