Java Solution || 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```java []\nclass Solution {\n    public int numberOfChild(int n, int k) {\n        int t = (n-1)*2;\n        k = k%t;\n\n        if(k<n){\n            return k;\n        }\n\n        return t-k;\n    }\n}\n```
['Java']