Java | Easy | Greedy
\nclass Solution {\n    public boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        //Sorting helps to find the best suitable asteroid greedily to d
```\nclass Solution {\n    public boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        //Sorting helps to find the best suitable asteroid greedily to destroy\n         Arrays.sort(asteroids);\n         long cm = mass;\n         for(int val : asteroids){\n             if(cm >= val){\n                 cm += val;\n             }\n             else return false;\n         }\n        return true;\n    }\n}\n```
['Greedy', 'Sorting']