Given an array of integers nums, redesign the array such that elements alternate between elements smaller and greater than their adjacent neighbors (i.e., nums[0] < nums[1] > nums[2] < nums[3]... or…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.