C++, stable_sort
\nclass Solution {\npublic:\n    vector<string> reorderLogFiles(vector<string>& logs) {\n        stable_sort(logs.begin(), logs.end(), [](auto &a, auto &b) {\n 
```\nclass Solution {\npublic:\n    vector<string> reorderLogFiles(vector<string>& logs) {\n        stable_sort(logs.begin(), logs.end(), [](auto &a, auto &b) {\n            if (isdigit(a.back()))  \n                return false;\n            if (isdigit(b.back())) \n                return true;\n            const auto aa = a.substr(a.find(\' \'));\n            const auto bb = b.substr(b.find(\' \'));\n            if (aa == bb)\n                return a < b;\n            return aa < bb; \n        });\n       \n        return logs;\n    }\n};\n```
['C']