Amazon Interview Question

permutations of a string