Print all permutations of k elements from the positive integers 1,2,3,…,n.
A permutation is a way of selecting items from a larger group, where the order matters.
Input:
3 2
Output:
1 2 1 3 2 1 2 3 3 1 3 2