10 XP challenge
Interleave Two Equal Lists
easy
Build it yourself · 6 min
1 Learn2 Predict3 Solve
TaskYour mission
Return left[0], right[0], left[1], right[1], and so on. left and right have the same length, from 0 to 20, and contain integers from -100 to 100.
Examples
| Input | Return |
|---|---|
left = [1,2], right = [8,7]answer: [] → [1] → [1,8] → [1,8,2] → [1,8,2,7]. The result is [1,8,2,7]. | [1,8,2,7] |
left = [0,0], right = [1,2]answer: [] → [0] → [0,1] → [0,1,0] → [0,1,0,2]. The result is [0,1,0,2]. | [0,1,0,2] |
Your code
Write your answer inside Solution, then use return to send it back.
Ln 1, Col 1
JavaScript
Try examples runs the public examples. Check my code checks your full answer and saves your completion.