C++ | Greedy | Sorting
This is a straightforward greedy problem , You cant possibly collide all asteroids in any order , if it isnt possible to collide them in an increasing order of 
**This is a straightforward greedy problem , You cant possibly collide all asteroids in any order , if it isnt possible to collide them in an increasing order of their masses.**\n```\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& asteroids) {\n        sort(asteroids.begin(),asteroids.end());\n        long long c=0;\n        long long m = mass;\n        for(auto x : asteroids){\n            if(x>m)\n                return false;\n            else{\n                m+=(x);\n                c++;\n            }\n        }\n        \n        return c==asteroids.size();\n    }\n};\n```
[]