10 XP challenge
Collect All Matching Positions
easy
Build it yourself · 6 min
1 Learn2 Predict3 Solve
TaskYour mission
Return all zero-based indices where numbers equals target, in increasing order. numbers contains 0 to 30 integers from -100 to 100; target is in that range.
Examples
| Input | Return |
|---|---|
numbers = [4,2,4], target = 4answer: [] → [0] → [0,2]. The result is [0,2]. | [0,2] |
numbers = [], target = 4 | [] |
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.