simple solution
Intuitionsimulate the process - this time, starting at 0, using a boolean flag to determine the upper and lower boundApproachComplexity
Time complexity:

Space
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
simulate the process - this time, starting at 0, using a boolean flag to determine the upper and lower bound

# Approach
<!-- Describe your approach to solving the problem. -->

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

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

# Code
```python3 []
class Solution:
    def numberOfChild(self, n: int, k: int) -> int:
        flag = True
        start = 0
        for i in range(k):
            print(start)
            if flag:
                start += 1
            if not flag:
                start -= 1
            if start == n - 1:
                flag = False
            if start == 0:
                flag = True 
        print(start)
        return start
```
['Python3']