My Logic And Code are correct still Getting wrong Answer I also tried Sorting String in descending order using comp but still getting wrong answer

Question : https://hack.codingblocks.com/app/contests/1786/394/problem

hello @yashratnani6

the code is correct but the output order is incorrect ( u need to print strings in ascending oreder).

to rectify this->
store all the valid strings in vector .
and then sort the vector and then print

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.