Back to QuestionsPractice with This Question
Wiggle Sort II
46.8K views•Asked at Microsoft•
Hard
Question Explain
Given an unsorted array `nums`, reorder it such that $nums[0] < nums[1] > nums[2] < nums[3] \dots$. Must be solved in $O(n)$ time with $O(1)$ extra space.
Start Trying This Question Simulation
Practice answering orally or with text to get instant AI feedback.