Javascript solution - no sort
Runtime:\xA0172 ms, faster than 100.00% of JavaScript online submissions\nvar asteroidsDestroyed = function(mass, asteroids) {\n   let total = asteroids.length;
Runtime:\xA0172 ms, faster than 100.00% of JavaScript online submissions\n```var asteroidsDestroyed = function(mass, asteroids) {\n   let total = asteroids.length;\n   while (true){\n     let cnt = 0;\n     for (let i=0; i < asteroids.length; i++) {\n       if (asteroids[i] !== undefined){\n         if (asteroids[i] <= mass){\n           mass += asteroids[i] ;\n           asteroids[i] = undefined;\n           cnt++;   \n           total--;\n           if (!total)\n            return true;\n         }  \n       }     \n     }\n     if (!cnt)\n       return false;\n   }\n};\n```
[]