Easy C++ Solution using Priority Queue
Create a Priority queue (pq)\n2. as long as size of pq > 1:\n every time pop two elements \n subtract second from first\n* if res of subtractions is non-zero pu
1. Create a Priority queue (pq)\n2. as long as size of pq > 1:\n* every time pop two elements \n* subtract second from first\n* if res of subtractions is non-zero push this result back into pq\nCODE:\n```\nint lastStoneWeight(vector<int>& stones) {\n     priority_queue<int> pq;\n      for(auto i : stones)        pq.push(i);\n      while(pq.size() > 1)\n      {\n          int a = pq.top(); pq.pop();\n          int b = pq.top(); pq.pop();\n          if(a  - b > 0)\n              pq.push(a-b);\n      }\n      return pq.empty()?0:pq.top();  \n    }\n
[]