JAVA very easy solution
\n\n# Code\n\nclass Solution {\n    public boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        Arrays.sort(asteroids);\n        int c=0;\n        l
\n\n# Code\n```\nclass Solution {\n    public boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        Arrays.sort(asteroids);\n        int c=0;\n        long s=(long)mass;\n        for(int i=0;i<asteroids.length;i++)\n        {\n            long d=(long)asteroids[i];\n            if(s>=d)\n            {\n                c+=1;\n                s+=d;\n            }\n        }\n        if(c==asteroids.length)return true;\n        else return false;\n    }\n}\n```
['Array', 'Greedy', 'Sorting', 'Java']