simple solution with basic mathod
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 
# 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```\nclass Solution {\npublic:\n    int numberOfChild(int n, int k) {\n        n=n-1;\n    int rem=k/n;\n    int del=k%n;\n    int ans;\n    if(rem%2==0)\n    {\n        ans= del;\n    }\n    if(rem%2!=0)\n    {\n        ans=n-del;\n    }\n    \n     return ans;\n    //     int i=0;\n    //     if(k<n)\n    //     {\n    //         return k;\n    //     }\n    //    while (i < n && k >= 0) {\n    //         if (i == n - 1&& k>=0) {\n               \n    //             while (i >= 0 && k >= 0) {\n    //                 k--;\n    //                 i--;\n    //                 cout<<"Hi"<<" "<<"i,k"<<endl;\n    //             }\n    //         } else {\n               \n    //             i++;\n    //             k--;\n    //              cout<<"hellow"<<" "<<"i,k"<<endl;\n    //         }\n            \n    //     }\n        \n    //    return i+1;\n    \n    }\n};\n```
['C++']