← Amazon questions

Move duplicates to the right

Filed under Amazon

Given an array of integers, identify duplicate elements, replace them with 1, and move all 1s (both original and newly formed) to the right side of the array while maintaining the relative order of…

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

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