Easiest C++ solution || Greedy approach
\n\n# Code\n\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& asteroids) {\n        sort(asteroids.begin(), asteroids.end());\n   
\n\n# Code\n```\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& asteroids) {\n        sort(asteroids.begin(), asteroids.end());\n        int n = asteroids.size();\n        long long weight = mass;\n        for(int i=0; i<n; i++){\n            if(weight >= asteroids[i]){\n                weight += asteroids[i];\n            }\n            else{\n                return false;\n            }\n        }\n\n        return true;\n    }\n};\n```
['Array', 'Greedy', 'Sorting', 'C++']