Not able to think of any approach

Can you please help me with the approach.

Hey @prerna_gupta31
The approach is very similar to that of print permutations. After generating all of the permutations and store in list and sort the list .you need to do is compare your ans with the original String and print only when the ans is smaller than the original String.

https://ide.codingblocks.com/s/340898 I tried implementing the code but it is wrong… Please help

Do I need to learn backtracking first?

Do you know how to permute the string ? If not then you have to learn that first