← Visa questions

Make array zig-zag

Filed under Visa

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.

Related Visa questions

Collected from public candidate posts and coding forums. Updated Nov 2026.