Given a string with all distinct characters, the task is to generate all permutations of the string. For a n-letter string, there should be n! strings as output. For repeating characters, there are corresponding duplicates.
An example of the program: Input: abc
Output:
- abc
- acb
- bac
- bca
- cba
- cab
The following image shows the description of above permutations: