5 XP challenge
Update a Balance
very easy
Build it yourself · 3 min
1 Learn2 Predict3 Solve
TaskYour mission
Return starting + received - paid. All inputs are integers from 0 to 100; the final balance may be negative.
Examples
| Input | Return |
|---|---|
starting = 10, received = 4, paid = 3balance: 10 → 14 → 11. The result is 11. | 11 |
starting = 0, received = 0, paid = 0 | 0 |
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.