SAP Interview Question

print all permutations of a string