Domanda di colloquio di eBay

finding all permutations of a string with minimum complexity