UnifyApps interview question

Wriggle Sort 2 from Leetcode