5 XP challenge
Advance a Circular Counter
very easy
Build it yourself · 3 min
1 Learn2 Predict3 Solve
TaskYour mission
Advance start by steps positions in a cycle of length cycle and return the final position. cycle is 1 to 20; start is 0 to cycle-1; steps is 0 to 40.
Examples
| Input | Return |
|---|---|
start = 2, steps = 3, cycle = 5position: 2 → 3 → 4 → 0. The result is 0. | 0 |
start = 2, steps = 0, cycle = 5 | 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.