American Express Interview Question

Generate all permutations of a string.