Simple Easy to Understand Java Code || Beats 100%
Complexity\n- Time complexity:\nO(n)\n- Space complexity:\nO(1)\n# Code\njava []\nclass Solution {\n    public int numberOfChild(int n, int k) {\n        return
# Complexity\n- Time complexity:\nO(n)\n- Space complexity:\nO(1)\n# Code\n```java []\nclass Solution {\n    public int numberOfChild(int n, int k) {\n        return (n-1) - Math.abs((n-1) - k%((n-1)*2));\n    }\n}\n```
['Math', 'Java']