โ† Zoho questions

Sort an array with distance constraints

Filed under Zoho

Sort an array of numbers such that no element moves more than two positions from its original index, and count the number of passes or swaps required.

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 Zoho questions

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