greedy approach (no need to use long long)  || o(n log n) || C++
\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& ast) {\n        sort(ast.begin(),ast.end());\n\t\tint max = 100000;\n        for
```\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& ast) {\n        sort(ast.begin(),ast.end());\n\t\tint max = 100000;\n        for(auto &i: ast){\n            if(mass < i){\n                return false;\n            }\n            mass += i;\n\t\t\t\t\n\t\t\t// the largest possible value of asteroids[i] is 10^5\n            if(mass > max) return true; \n\t\t\t// no need to check further if the mass gets greater than max(10^5) because after this we can destroy any asteroids\n\t\t\t\n        }\n        return true;\n    }\n};\n```\n\n   : ) \uD83D\uDC4D\uD83D\uDC4D :-)
['C', 'C++']