Challenges - Permutation Challenge

String Permutation Challenge

Here is another mathematical problem, where the trick is as much to discover the algorithm as it is to write the code: write a program to display all possible permutations of a given input string--if the string contains duplicate characters, you may have multiple repeated results. Input should be of the form

permute string
and output should be a word per line.

Here is a sample for the input cat

cat
cta
act
atc
tac
tca

View Solution