Can you please help me with the approach.
Not able to think of any 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.
Do I need to learn backtracking first?
Do you know how to permute the string ? If not then you have to learn that first