LinkedIn Interview Question

output all the permutations and compute the code time complexity