2126. Destroying Asteroids
Pay attention to the long time based on the data range.\n\nclass Solution {\n    public boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        Arrays.
Pay attention to the long time based on the data range.\n```\nclass Solution {\n    public boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        Arrays.sort(asteroids);\n        long massL = mass;\n        for (int ast : asteroids) {\n            if (ast > massL) {\n                return false;\n            }\n            massL += ast;\n        }\n        return true;\n    }\n}\n```
['Greedy', 'Sorting', 'Java']