🏆🔥✅Simplest Ever Solution🏆🔥✅
\uD83D\uDE09Don\'t just watch & move away, also give an Upvote.\uD83D\uDE09\n\n# Complexity\n- Time complexity: O(n.log(n))\n Add your time complexity here, e.g
# \uD83D\uDE09Don\'t just watch & move away, also give an Upvote.\uD83D\uDE09\n\n# Complexity\n- Time complexity: $$O(n.log(n))$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    bool asteroidsDestroyed(int mass, vector<int>& astr) {\n        sort(begin(astr), end(astr));\n\n        long long m = mass;//to avoid integer overflow\n\n        for(auto i:astr)\n        {\n            if(i<=m)\n            {\n                m+=i;\n            }\n            else\n                return false;\n        }\n\n<!-- \u2705Well before returning answer don\'t forget to UPVOTE.\u2705 -->\n        return true;\n    }\n};\n```\n![Leetcode Upvote.gif](https://assets.leetcode.com/users/images/aa330a48-1f67-46ae-a0b6-b4b2595f4167_1697960731.5983794.gif)\n
['Array', 'Greedy', 'C', 'Sorting', 'Python', 'C++', 'Java', 'JavaScript']