MindTickle interview question

Print all the permutations on an array.