Wana Destroy Asteroids in a Simple Way...🌠🌠🌠
Intuition\nJust sort the asteroids array and compare with the planet mass\n\n# Approach\nstep 1:Sort the asteroids array\n\nstep 2:Take a long varable to store 
# Intuition\nJust sort the asteroids array and compare with the planet mass\n\n# Approach\nstep 1:Sort the asteroids array\n\nstep 2:Take a long varable to store the mass because some test cases may contain lage numbers which makes our int mass to a long number\n\nstep 3:Now iterate the asteroids array acc to the condition\n       if((planet_mass>=asteroids[i])\n            add this asteroids mass to the long varable\n       If this condition fails \n            just return false\n\nstep 4:return true\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public boolean asteroidsDestroyed(int mass, int[] asteroids) {\n        Arrays.sort(asteroids);\n        long planet_mass=mass;\n\n        for(int i=0;i<asteroids.length;i++)\n        {\n            if(planet_mass>=asteroids[i])\n            {\n                planet_mass+=asteroids[i];\n               \n            }else{\n                return false;\n            }\n        }\n        return true;\n    }\n}\n```
['Java']