WA in some test cases

Test cases 2 and 3 are giving wrong answer.
I have tested many case and getting correct answer for all of them.
My code:

Test case 123 -:
Your code is giving correct answer but in wrong order.

In which order i have to print?

In Increasing order (Lexiographically) .

Now 1st test case shows wa.
MY CODE :

Your code is correct. Your printing order is different from the output.
You can use string instead of char array to get that order.

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.