Very Simple C Solution 100%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n1. when current reaches
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. when current reaches end then traverse in reverse direction else traverse forward\n# Complexity\n- Time complexity:O(k)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nint numberOfChild(int n, int k) {\n    int cur=0;\n    int time=0;\n    while(time!=k){\n        if(cur==n-1&&time<k){\n            while(cur!=0&&time<k){\n                cur--;\n                time++;\n            }\n        }\n        else{\n            while(cur!=n-1&&time<k){\n                time++;\n                cur++;\n            }\n        }\n    }\n    return cur;\n}\n```
['C']