Given and array of integers sort the array into a wave-like array.
In other words, rearrange the elements into a sequence such that
If multiple solutions are available, return lexicographically smaller.
Input: [1, 2, 3, 4]
Output: [2, 1, 4, 3]
Solution coming up... :)