numberOfChild: beautiful O(1) solution. BEAT 100%. ✅
IntuitionTo determine which child will have the ball after k seconds, we need to consider the direction changes when the ball reaches the ends of the line. The
# Intuition
To determine which child will have the ball after `k` seconds, we need to consider the direction changes when the ball reaches the ends of the line. The ball will move back and forth between the children based on the number of passes.

# Approach
1. Check if the quotient of \(k\) divided by \(n-1\) is even or odd to determine the final direction of the ball.
2. If even, the ball will move in the same direction as the initial direction.
3. If odd, the ball will move in the opposite direction after reaching the end.
4. Use the modulus operator to determine the position of the child based on the remaining passes.

# Complexity
- Time complexity:
O(1)

- Space complexity:
O(1)

# Code
```c []
int numberOfChild(int n, int k) {
    if((k/(n-1))%2==0) return k%(n-1);
    else return n-k%(n-1)-1;
}
```
['Math', 'C']