[c++] use sort(), self define sort comparison
\nclass Solution\n{\npublic:\n\tvector<string> reorderLogFiles(vector<string>& logs)\n\t{\n\t\tvector<string> ret;\n\t\tvector<string> digs;\n\t\tvector<pair<st
```\nclass Solution\n{\npublic:\n\tvector<string> reorderLogFiles(vector<string>& logs)\n\t{\n\t\tvector<string> ret;\n\t\tvector<string> digs;\n\t\tvector<pair<string, string>> letts;\n\t\tfor(string& s : logs)\n\t\t{\n\t\t\tint i = 0;\n\t\t\twhile(s[i] != \' \')\n\t\t\t\ti++;\n\t\t\tif(isdigit(s[i+1]))\n\t\t\t\tdigs.push_back(s);\n\t\t\telse\n\t\t\t\tletts.push_back({s.substr(0, i), s.substr(i+1)});\n\t\t}\n\t\tsort(letts.begin(), letts.end(), [&](auto& a, auto& b){return a.second == b.second ? a.first < b.first : a.second < b.second;});\n\t\tfor(auto it : letts)\n\t\t\tret.push_back(it.first + \' \' + it.second);\n\t\tfor(string it : digs)\n\t\t\tret.push_back(it);\n\t\treturn ret;\n\t}\n};\n\n\n\n```
['C']