NVIDIA interview question

Print all permutations of a given string.