C++ solution || greedy || sort
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity :   O(Nlog(N))\n\n- Space complexity :  O(1)\n\n# Code\n```\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& ast) {\n        sort(ast.begin(),ast.end());\n        long long m = mass;\n        int n = ast.size();\n        for(int i=0;i<n;i++){\n            if(m>=ast[i]){\n                m += ast[i];\n            }else return false;\n        }\n        return true;\n    }\n};\n```
['Greedy', 'Sorting', 'C++']