Amazon interview question

Create permutations of a string