Given a string,you are supposed to print all its distinct anagrams in sorted order.
length of string <=10
Input contains many Strings,Read till End of File
For each input string print its distinct anagrams in sorted order,one per line
Output of 2 consequtive cases must be seperated by a newline
You can solve this very easily using next_permutation, but try not using it.
Solve it using recursion.
Problem Setter: Jayant Mukherji