← Walmart questions

Rearrange array elements such that A[i] = i

Filed under Walmart

Given an array of size N containing integers from 0 to N-1 and -1, rearrange the array such that A[i] = i. If i is missing, keep -1.

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

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