[C++] PriorityQueue Solution
\n// Time: O(NlogN)\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& asteroids) {\n        priority_queue<int,vector<int>, greater
```\n// Time: O(NlogN)\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& asteroids) {\n        priority_queue<int,vector<int>, greater<int>> q;\n        for(auto as: asteroids) q.push(as);\n        long long curr = mass;\n        while(!q.empty()) {\n            int as = q.top();\n            q.pop();\n            \n            if(as > curr) return false;\n            else curr += as;\n        }\n        \n        return true;\n    }\n};\n```
['C', 'C++']