C++ - very easy solution
\nclass Solution {\npublic:\n    vector<string> reorderLogFiles(vector<string>& logs) {\n        int pos = logs.size() - 1;\n        \n        for (int i = logs
```\nclass Solution {\npublic:\n    vector<string> reorderLogFiles(vector<string>& logs) {\n        int pos = logs.size() - 1;\n        \n        for (int i = logs.size() - 1; i >= 0; --i)\n            if (!isalpha(logs[i][logs[i].find(\' \') + 1]))\n                swap(logs[i], logs[pos--]);\n        \n        sort(logs.begin(), logs.begin() + pos + 1, [](const string& lhs, const string& rhs) {\n            const string lhsSub = lhs.substr(lhs.find(\' \') + 1);\n            const string rhsSub = rhs.substr(rhs.find(\' \') + 1);\n            \n            if (lhsSub == rhsSub)\n                return lhs < rhs;\n            \n            return lhsSub < rhsSub;\n        });\n        \n        return logs;\n    }\n};\n```
['C']