Booking.com Interview Question

The coding question was a simple permutation related problem, can be solved using recursion.