Only one test case of mine is passing

according to me i am doing right but still its not appending as given in sample output

@anyamaurya you have repeated some of the mistakes as your previous doubt for merge sort, please have a look at that and make the changes here as well.

i am getting tle and run error

@anyamaurya if k > n you are returning the head as it is, that is wrong. Do k = k % n instead.

@anyamaurya In this code, the build function is wrong. (you are inserting first, without taking any input. reverse the order of the statements, ie first take input and then insert it in the list.) There are a few logical mistakes in the kthnode() function as well, i have corrected them here

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.