← Swiggy questions
CodingReported in a candidate post, Jul 2025

Expand an array so each element is followed by its duplicate in place

Filed under Swiggy

You are given an array of size 2n whose first n entries are values and whose last n entries are zeros (free space). Rewrite the array in place so that each original value is immediately followed by a…

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

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