Dictionary order(larger and smaller)


what changes i have to do in this code so that it print the string greater or smaller than the given string

take a copy of original char* in the paramter which is not updated in the process
so in the base case check if the upated permutation is greater than original ( greater permutation case)
only then add to a vector [ why vector ?]
because u are required to print the answer in dictionary order.
so it need to be sorted

check tthis for reference

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.