Simple C++ solution || Short Code || Sorting
\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& ast) {\n        sort(ast.begin(),ast.end());\n        // 3 5 9 19 21\n        //
```\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& ast) {\n        sort(ast.begin(),ast.end());\n        // 3 5 9 19 21\n        // 3 8 17 36 57\n        // 13 18 27 56 62    \n         vector<long long> v(ast.size());\n        for(int i=0;i<ast.size();i++)\n            v[i]=ast[i]*1LL;\n            \n        v[0]+=mass*1LL;\n        for(int i=1;i<v.size();i++)\n        { \n          v[i]+=v[i-1]; \n         \n        }\n        if(mass<ast[0])\n          return 0;\n        for(int i=1;i<ast.size();i++)\n        {\n            if(v[i-1]<ast[i])\n                return 0;\n        }\n        return 1;\n    }\n};\n```
['C', 'Sorting']