5 XP challenge
Distance Between Endpoints
very easy
Build it yourself · 3 min
1 Learn2 Predict3 Solve
TaskYour mission
Return the absolute difference between the first and last values. values has 1 to 30 integers from -100 to 100.
Examples
| Input | Return |
|---|---|
values = [3,8]difference: -5 → 5. The result is 5. | 5 |
values = [8,3] | 5 |
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.