← All problemsSign in

Ring a Ring o Roses

Consider $N$ children playing Ring a Ring o’ Roses. While playing they move in anti-clockwise direction. With each step, child $x$ (who is initially at position $x$) moves to $(x-1)$th position. $N$ such steps contributes to one rotation. Given $n$ (number of steps) and the initial position of the child $x$, find the position of the child after taking $n$ steps. ###Constraints: - 1 <= N <= 1

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start