10 XP challenge
Clamp Every Reading
easy
Build it yourself · 6 min
1 Learn2 Predict3 Solve
TaskYour mission
Return numbers with every value restricted to the inclusive range low to high. Preserve order and length. numbers contains 0 to 30 integers from -100 to 100; -100 <= low <= high <= 100.
Examples
| Input | Return |
|---|---|
numbers = [-2,4,9], low = 0, high = 5answer: [] → [0] → [0,4] → [0,4,5]. The result is [0,4,5]. | [0,4,5] |
numbers = [], low = 0, high = 10 | [] |
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.