C++ 0ms   faster than 100% (using priority_queue)
\nclass Solution {\npublic:\n    int lastStoneWeight(vector<int>& stones) {\n        priority_queue<int> qu(stones.begin(),stones.end());\n        \n        whi
```\nclass Solution {\npublic:\n    int lastStoneWeight(vector<int>& stones) {\n        priority_queue<int> qu(stones.begin(),stones.end());\n        \n        while(qu.size() != 0 && qu.size() != 1){\n            int temp1 = qu.top();\n            qu.pop();\n            int temp2 = qu.top();\n            qu.pop();\n            \n            if(temp2 != temp1) qu.push(temp1 - temp2); \n        }\n        \n        if(!qu.size()) return 0;\n        else return qu.top();\n    }\n};\n```
[]