SIMPLE SOLUTION USING SORTING|| EASIEST SOLUTION
class Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector& ast) {\n       long long int sum=mass;\n       long long int n=ast.size();\n        sor
class Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& ast) {\n       long long int sum=mass;\n       long long int n=ast.size();\n        sort(ast.begin(),ast.end());\n        for(int i=0;i<n;i++)\n        {\n           if(sum>=ast[i])\n               sum+=ast[i];\n            else\n                return false;\n        }\n        return true;\n       \n    }\n};
['C', 'Sorting']