Question d’entretien chez eBay

finding all permutations of a string with minimum complexity