Simple solution in Java. Beats 100 %
Complexity

Time complexity:
O(1)


Space complexity:
O(1)

Code
# Complexity
- Time complexity:
O(1)

- Space complexity:
O(1)

# Code
```java []
class Solution {
    public int numberOfChild(int n, int k) {
        n = n - 1;
        int rounds = k / n;
        int remainingSteps = k % n;

        if (rounds % 2 == 0) {
            return remainingSteps;
        } else {
            return n - remainingSteps;
        }
    }
}
```
['Java']