Amazon Interview Question

Write a program to get all permutations of a string