324. Wiggle Sort II
https://leetcode.com/problems/wiggle-sort-ii/
Problem
Given an unsorted array nums
, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]...
.
Example 1:
Example 2:
Note: You may assume all input has valid answer.
Follow Up: Can you do it in O(n) time and/or in-place with O(1) extra space?
Solution
#veryimportant
#sorting
Last updated
Was this helpful?