Amazon interview question

permutations of a string