Java Solution using sorting , Easy to understand
\nclass Solution {\n    public boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        Arrays.sort(asteroids);\n        long sum=mass;\n        for(int
```\nclass Solution {\n    public boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        Arrays.sort(asteroids);\n        long sum=mass;\n        for(int i=0;i<asteroids.length;i++){\n            if(sum>=asteroids[i]){\n                sum+=asteroids[i];\n            }else{\n                return false;\n            }\n        }\n        return true;\n    }\n}\n```
[]