Can't think of the approach

I tried but can’t think of any approach to solve this problem

@guptadev354
You have to sort the array only when k >= n. And then display the array in reverse order for largest permutation.
When k < n, you have to do k swaps to find the largest possible permutation starting from the index 0.