What is the error in my code

i am not able to pass all the test cases of the problem Linked List-K Append. please tell what is the error in my code.

@Usha24 you havent considered the cases where k > n
I have corrected your code here https://ide.codingblocks.com/s/261384 look at line 102.
Mark the doubt as resolved in case of no further queries :slight_smile:

actualluy i have added in the starting that if ( k >= n ) return the orignal head

it was not mentioned anywhere that for k > n we have to take modulus.

@Usha24 that is kind of obvious no? if k = 10 suppose, then rotate the list 10 times. Why would you not rotate it at all? That is not a logical issue.

OK got it, thanks for the help

I have asked another doubt for odd-then-even problem, please resolve that as well

@Usha24 it has been answered by another TA please check