🔥Very Easy to understand and intuitive O(1)🔥approach.Beginner friendly
\n\n# Complexity\n- Time complexity:\n O(1) \n\n- Space complexity:\nO(1)\n\n# Code\n\nclass Solution {\npublic:\n    int numberOfChild(int n, int k) {\n       
\n\n# Complexity\n- Time complexity:\n $$O(1)$$ \n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```\nclass Solution {\npublic:\n    int numberOfChild(int n, int k) {\n        if((k/(n-1))%2==0)\n            return k%(n-1);\n        return n-1-k%(n-1);\n        \n    }\n};\n```
['Math', 'C++']