Wave Array
Given an array of integers, sort the array into a wave like array and return it,
In other words, arrange the elements into a sequence such that a1 >= a2 <= a3 >= a4 <= a5.....
Example
NOTE : If there are multiple answers possible, return the one thats lexicographically smallest. So, in example case, you will return
[2, 1, 4, 3]
Last updated