vector Solution::reorderLogs(vector &A) { vectorres; set>s; vectordig; int n = A.size(); int j =0; for(auto x:A) { string str = ""; int i =0; while(x[i]!='-') { str.push_back(x[i]); i++; } if(x[i+1]>='a' && x[i+1]<='z') { s.insert({x.substr(i+1)+str,j}); } else { dig.push_back(j); } j++; } for(auto x:s) res.push_back(A[x.second]); for(auto x:dig) res.push_back(A[x]); return res; }