Simple Solution with O(N) without traditional sorting
Code\n\nclass Solution:\n    def asteroidsDestroyed(self, mass: int, asteroids: List[int]) -> bool:\n        s=[]\n        asteroids.sort()\n        for i in as
# Code\n```\nclass Solution:\n    def asteroidsDestroyed(self, mass: int, asteroids: List[int]) -> bool:\n        s=[]\n        asteroids.sort()\n        for i in asteroids:\n            s.append(i)\n            while s and s[-1]<=mass:\n                mass+=s.pop()\n        return not s\n\n\n```
['Python', 'Python3']