2 Liner C++ solutions Easy and Clean Explained
O(nlong(n)) solutions :\n\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int m, vector<int>& a,long long sum=0) {\n        sum=m;\n        sort(begin(a
**O(nlong(n)) solutions :**\n```\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int m, vector<int>& a,long long sum=0) {\n        sum=m;\n        sort(begin(a),end(a));\n        for(auto &i:a)if(sum>=i)sum+=i;else return 0;\n        return 1;\n    }\n};\n```\n**If you like this  solutions , please upvote for my motivations\nany doubt ---> comment\nThank you.**
['C']