Microsoft Interview Question

give all the permutations of an array