Collide all the asteroids in Ascending Order ( Sorting & Greedy)
TC=O(nlogn)\nSC=O(1)\n\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& a) {\n        sort(a.begin(),a.end());\n        long long 
**TC=O(nlogn)**\n**SC=O(1)**\n```\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& a) {\n        sort(a.begin(),a.end());\n        long long m=mass;\n        for(int i=0;i<a.size();i++)\n        {\n            if(m<a[i]) return false;\n            else\n            {\n                m+=a[i];\n            }\n        }\n        return true;\n    }\n};\n```\n
['Greedy', 'C', 'Sorting']