Java O(n), 18 ms, faster than 99.53% of Java online submissions
```\npublic boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        long current = mass;\n        int[] data = new int[100001];\n        int min = 1000
```\npublic boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        long current = mass;\n        int[] data = new int[100001];\n        int min = 100001;\n        int max = -1;\n        \n        for(int a : asteroids) {\n            min = Math.min(min, a);\n            max = Math.max(max, a);\n            data[a]++;\n        }\n        \n        for(int i = min; i <= max; i++) {\n            if(current < i && data[i] != 0)\n                return false;\n            \n            current += i * data[i];\n        }\n        \n        return true;\n    }\n\n
[]