Swift
```\n\nclass Solution {\n    func asteroidsDestroyed(_ mass: Int, _ asteroids: [Int]) -> Bool {\n        var s = asteroids.sorted()\n        var m = mass\n     
```\n\nclass Solution {\n    func asteroidsDestroyed(_ mass: Int, _ asteroids: [Int]) -> Bool {\n        var s = asteroids.sorted()\n        var m = mass\n        for i in 0..<s.count {\n            if m >= s[i] {\n                m = m + s[i]\n            } else {\n                return false\n            }\n        }\n        \n        return true\n    }\n}
[]