Recursion dictionary order smaller

https://ide.codingblocks.com/s/199291 passes only 4th test case

Hi,

You only need to correct your compare function. rest of code is correct. I can’t able to get what you are trying to do in this function. To get lexiographically sorted you can just put all permutations of the string in the set of strings. (set )

Ok got it, your mistake in the compare function is that you are not checking for those strings which are smaller than str. It is not necessary that the input string will be lexiographically smallest.

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.