NVIDIA Interview Question

find all permutations of given set