Microsoft interview question

Print all permutations of a string