Construct New Array
Problem Overview
- Construct a new array by alternately taking elements from the start and end of the input: first, last, second, second-last, until all are used.
- Input: array of integers; Output: reordered array of equal length.
- Constraints: 1 ≤ numbers.length ≤ 1e5 and numbers[i] in [-1e9, 1e9].
- Domain: array manipulation and sequence reordering for a coding interview.
- From Duolingo interviews, this interview question is a classic problem assessing index handling.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
