C++ using priority queue for letterlog
```\nclass Solution {\npublic:\nvector reorderLogFiles(vector& logs) {\n\tvectorans;\n\tvectordigitLog;\n\tpriority_queue, function\>pq_letter( {\n\t\tint idx_a
```\nclass Solution {\npublic:\nvector<string> reorderLogFiles(vector<string>& logs) {\n\tvector<string>ans;\n\tvector<string>digitLog;\n\tpriority_queue<string, vector<string>, function<bool(string, string)>>pq_letter([](const string& a, const string& b) {\n\t\tint idx_a = a.find(\' \');\n\t\tint idx_b = b.find(\' \');\n\t\tstring sub_a = a.substr(idx_a);\n\t\tstring sub_b = b.substr(idx_b);\n\t\tif (sub_a == sub_b) {\n\t\t\treturn a.substr(0, idx_a + 1) > b.substr(0, idx_b + 1);\n\t\t}\n\t\telse\n\t\t\treturn sub_a != sub_b ? sub_a > sub_b : a > b;\n\t\t});\n\t\tfor (auto l : logs) {\n\t\t\tint idx = l.find(\' \');\n\t\t\tidx++;\n\t\t\tif (idx < l.size() && isdigit(l[idx])) {\n\t\t\t\tdigitLog.emplace_back(l);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpq_letter.push(l);\n\t\t\t}\n\t\t}\n\t\twhile(!empty(pq_letter)) {\n\t\t\tans.emplace_back(pq_letter.top());\n\t\t\tpq_letter.pop();\n\t\t}\n\t\tans.insert(ans.end(), digitLog.begin(), digitLog.end());\n\t\treturn ans;\n}\n};
[]