K-append problem of linked list

https://ide.codingblocks.com/s/262975 in this code only 3 out of 6 are passing rest are failing. I am not able to figure out where the problem occurred. in many custom test cases, they are showing correct answer. please correct it.

@AlphaX there are some things that are not mentioned in the question but are there in the testcases .
first if k>n do k=k%n
second if(k==n) print linklist as it is
do these and i think it will pass. dont forget to hit like and mark resolved if cleared otherwise ask me :smiley:

thanks, I had missed the the point k=k%n.

np just mark resolved :smiley: