324. Wiggle Sort II
Description
Intuition
find the median value and do the dutch flag partition
For the quick selection of the kth element, check here
Then, we can using virtual index to do a sorting. The dutch flag partition problem, check 75. Sort Colors
Pitfall
Solution
Reference
- Virtual Index%2BO(1)-after-median-Virtual-Indexing)