Wiggle Sort 2
easy
1. Given an integer array 'arr'. 2. Reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... 3. You may assume the input array always has a valid answer. Note : You can return answer in any order.
Constraints
1. 1 <= nums.length <= 10^4 2. 0 <= nums[i] <= 5000 3. It is guaranteed that there will be an answer for the given input 'arr'.
Format
Input
Input: nums = [1,5,1,1,6,4]
Output
Output: [1,6,1,5,1,4] Explanation: [1,4,1,5,1,6] is also accepted.
Example
Sample Input
6
1 5 1 1 6 4
Sample Output
true