Easy Beginner friendly | Python code| Similar solution for Passing Pillow
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->Solve it like we solve passing pillow problem

# Approach
<!-- Describe your approach to solving the problem. -->See this similar solution
https://youtu.be/SR78dGOaxUs?si=WmiauViYAdmLrYAW

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->O(n)

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->O(1)

# Code
```python3 []
class Solution:
    def numberOfChild(self, n: int, k: int) -> int:
        direction = 1
        winner_position = 0
        for _ in range(k):
            if winner_position == 0:
                direction = 1
            elif winner_position == (n-1):
                direction = -1
            winner_position += direction
        return winner_position    
```
['Python3']