Simple Maths Solution C++ Beats 100%
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int numberOfChild(int n, int k) {\n        int comp = k / (n-1);\n        int rem = k % (n-1);\n\n        if(comp % 2 == 0){\n            return rem;\n        }\n        else{\n            return (n-1-rem);\n        }\n    }\n};\n```
['C++']