3
static bool comp(pair<string, string> a, pair<string, string> b) {4
if (a.second == b.second) return a.first < b.first;5
return a.second < b.second;7
vector<string> reorderLogFiles(vector<string> &logs) {8
vector<pair<string, string>> letter_logs;9
vector<string> digit_logs;11
for (int i = 0; i < logs.size(); i++) {12
string identifier = "";13
for (int j = 0; j < logs[i].length(); j++) {14
if (logs[i][j] == ' ') {15
if (logs[i][j + 1] >= 'a' && logs[i][j + 1] <= 'z')16
letter_logs.push_back({identifier, logs[i].substr(j + 1, logs[i].size() - j + 1)});18
digit_logs.push_back(logs[i]);21
identifier.push_back(logs[i][j]);25
sort(letter_logs.begin(), letter_logs.end(), comp);26
for (auto it : letter_logs) {27
cout << it.first + " " + it.second << endl;28
ans.push_back(it.first + " " + it.second);30
for (auto it : digit_logs) {