Basic Sorting
\nclass Solution {\n    public boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        Arrays.sort(asteroids);\n        for(int i = 0; i < asteroids.le
```\nclass Solution {\n    public boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        Arrays.sort(asteroids);\n        for(int i = 0; i < asteroids.length; ++i){\n            int astMass = asteroids[i];\n            if(astMass > mass) {\n                return false;\n            }\n            mass += astMass;\n            if(mass < 0) {      // checks integer overflow and return early\n                return true;    \n            }\n        }\n        return true;\n    }\n}\n```
['Sorting', 'Java']