Video Explanation Solution easy to understand | Programming with Pirai | Half Moon Coder.
Video : https://youtu.be/lc5IuVczpNI\n\n# Code\npython3 []\nclass Solution:\n    def numberOfChild(self, n: int, k: int) -> int:\n        pos=0\n        directi
# Video : https://youtu.be/lc5IuVczpNI\n\n# Code\n```python3 []\nclass Solution:\n    def numberOfChild(self, n: int, k: int) -> int:\n        pos=0\n        direction=1\n        for i in range(k):\n            if direction==1:\n                if pos==n-1:\n                    direction=-1\n                pos+=direction\n            else:\n                if pos==0:\n                    direction=1\n                pos+=direction\n        return pos\n```
['Math', 'Simulation', 'Python3']