Explanation
Where N is the number of players practicing, K the player that receive the ball first, and P the number of passes that need to be done. Follow these step to find the last player who receive the ball.
- P = P % N
- K = K + P
- K = K % N
- If K equal 0 then set K to the value of N, else just stick to the current value.
Source Code
Tidak ada komentar:
Posting Komentar