Shortest solution using Min Heap (PriorityQueue)
Step 1: Put the array into a min heap. To avoid creating a custom comparer, let\'s just revert priorities (-x).\nStep 2: Get the two "heaviest" stones from the 
**Step 1:** Put the array into a min heap. To avoid creating a custom comparer, let\'s just revert priorities (`-x`).\n**Step 2:** Get the two "heaviest" stones from the heap and smash them together. If there is something left, put it back into the heap.\n\n```csharp\npublic int LastStoneWeight(int[] stones)\n{\n    var q = new PriorityQueue<int, int>(stones.Select(x => (x, -x)));\n    \n    while (q.Count > 1)\n    {\n        int a = q.Dequeue() - q.Dequeue();\n        if (a != 0) q.Enqueue(a, -a);\n    }\n        \n    return (q.Count == 0) ? 0 : q.Peek();\n}\n```
['Heap (Priority Queue)', 'C#']