CPP:Recursion - Dictionary Order(Smaller)

Why is my code failing all the test cases ?

My code is :

It is given that the output must be in sorted order. You code will generate the correct permutations but it is not guaranteed that your output will be sorted. For that…instead of printing in base case…you must push it in a vector.You should then sort the resulting vector in the main before printing the final result.
Check this:

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.