easy solution in cpp.
class Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector& arr) {\n       sort(arr.begin(),arr.end());\n        int n=arr.size();\n        long lo
class Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& arr) {\n       sort(arr.begin(),arr.end());\n        int n=arr.size();\n        long long int sum=mass;\n        for(int i=0;i<n;i++){\n            if(arr[i]>sum){\n                return false;\n            }\n            else\n                sum+=arr[i];\n        }\n        return true;\n    }\n};
['C', 'Sorting']