CodingMedium
Place odd numbers at odd indices and even at even indices
Filed under Drishti-Soft Solutions
The question
Given an array of even length where half the elements are even and half are odd, rearrange the array in-place such that odd numbers are at odd indices and even numbers are at even indices, without changing the relative order of numbers.
No write-up yet. Related questions below have one.
Related Drishti-Soft Solutions questions
Collected from public candidate posts and coding forums. Updated Nov 2026.