Back to Questions

Wiggle Sort II

46.8K viewsAsked 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.

Practice with This Question