What is the criteria to compare 2 strings?


#1

what is the criteria to compare 2 strings?


#2

Lexicographic order. I suggest You get the output array First then Just sort it using normal library sort function. They have considered that overhead in Time Limit. if you are using C++ use std::sort().