✅🐍 Python simulation 🐍✅
Code
\n# Code\n```python3 []\nclass Solution:\n    def numberOfChild(self, n: int, k: int) -> int:\n        i = 0\n        direction = True\n        while k > 0:\n            if direction and i == n - 1:\n                direction = False\n                i -= 1\n            elif not direction and i == 0:\n                direction = True\n                i += 1\n            elif direction:\n                i += 1\n            else:\n                i -= 1\n            k -= 1\n        \n        return i\n```
['Simulation', 'Python3']