Amazon interview question

Implement a function to print out all the permutations of an input string