Recording C++ solution
\nclass Solution {\npublic:\n    vector<string> reorderLogFiles(vector<string>& logs) {\n\n        vector<pair<string, string>> Letter_logs;\n        vector<str
```\nclass Solution {\npublic:\n    vector<string> reorderLogFiles(vector<string>& logs) {\n\n        vector<pair<string, string>> Letter_logs;\n        vector<string> Digit_logs, ans;\n\n        for (string& log : logs) {\n            int i = log.find(\' \');\n            if (isdigit(log[i + 1]))\n                Digit_logs.push_back(log);\n            else\n                Letter_logs.push_back({ log.substr(i + 1), log.substr(0, i) });\n        }\n\n        sort(Letter_logs.begin(), Letter_logs.end());\n\n        for (auto it : Letter_logs)\n            ans.push_back(it.second + " " + it.first);\n        for (string it : Digit_logs)\n            ans.push_back(it);\n\n        return ans;\n    }\n};\n```
[]