

The input string may contain the same characters, so there will also be the same permutations.
The order of permutations doesn’t matter.
The only input line contains a string (STR) of alphabets in lower case
Print each permutations in a new line
1<=length of STR<=8
Time Limit: 1sec
We can find all the permutations by Backtracking.
1:Fix a character then swap all the rest of the remaining character with a fixed character.
2:Then find all permutations for all remaining characters by the recursive call.
3:The base case for the recursion will be when there is only one character left unprocessed.
Below is the illustration to approach.