Sort and Accumulate
Not sure why such an easy problem appeared as #3 in the contest.\n\nC++\ncpp\nbool asteroidsDestroyed(int mass, vector<int>& a) {\n    sort(begin(a), end(a));\n
Not sure why such an easy problem appeared as #3 in the contest.\n\n**C++**\n```cpp\nbool asteroidsDestroyed(int mass, vector<int>& a) {\n    sort(begin(a), end(a));\n    return accumulate(begin(a), end(a), mass, [](int m, int a){\n        return m < a ? 0 : min(100000, m + a);\n    });\n}\n```
[]