Intel Corporation Interview Question

Print all permutations of a string in best runtime