✅ Simple easy c++ solution
\n\n\n int lastStoneWeight(vector<int>& stones) \n    {\n        priority_queue<int> pq(stones.begin(),stones.end());\n        while(pq.size()>1)\n        {\n  
![image](https://assets.leetcode.com/users/images/fc5f29d9-7e2e-4f5b-a3d9-2c5654652b76_1649292145.9654834.png)\n\n```\n int lastStoneWeight(vector<int>& stones) \n    {\n        priority_queue<int> pq(stones.begin(),stones.end());\n        while(pq.size()>1)\n        {\n            int y=pq.top();\n            pq.pop();\n            int x=pq.top();\n            pq.pop();\n            if(x!=y) pq.push(y-x);\n        }\n        return pq.empty()? 0 : pq.top();\n    }\n```
[]