Easy c++ solution using sort
\'\'\'\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector& ast) {\n        long long int sum=mass;\n        sort(ast.begin(),ast.end());\n
\'\'\'\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& ast) {\n        long long int sum=mass;\n        sort(ast.begin(),ast.end());\n        for(int i=0;i<ast.size();i++){\n            if(sum>=ast[i]) sum+=ast[i];\n            else return false;\n        }\n        return true;\n    }\n};
['C', 'Sorting', 'C++']