Solution: Shuffle Integers

This review discusses the solution of the shuffle integers challenge in detail.

Solution:

We can solve this problem using a divide and conquer approach. The idea is to divide the given list into half (say lst1 and lst2) and swap the second (right) half element of lst1 with the first (left) half element of lst2. Keep doing this recursively for lst1 and lst2.

Let’s elaborate it more with the help of an illustration:

1 / 5

Boundary cases

You need to take care of the following extreme cases in your program:

  1. When there are only 22
...

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.