Given an unsorted array of numbers, rearrange its elements in an alternating max-min pattern: 1st element is the maximum, 2nd is the minimum, 3rd is the 2nd maximum, 4th is the 2nd minimum, and so on.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.