Linked list k th append

where i am wrong in the code

3 out of 6 test case passed

Hey @officialharshit1996
try taking k=k%length of linked list i.e k%=n before rest of the logic

Let me know if this works or not

all test case passed ,new code->https://ide.codingblocks.com/s/407266, why work?

Because when k is greater than n
than say k =n+1 so you have to actually append only 1 node at last here