Amazon Interview Question

permutations of string