Linked List K Append

https://ide.codingblocks.com/s/196655 I am unable tp attach the remaining linked list here. What is the mistake here ?

@abhishekjohri98,
I have corrected your code: https://ide.codingblocks.com/s/196674
Your were not updating this.head that’s why the error.

Also, your code will give error for:
2
1 2
2
So please check that and I also added n=n%N because if n is 10 and N is 7. The number of rotations is 3, always.

Thanks for the solution but still I am facing run-error in one test case here ?

@abhishekjohri98,
I told you your code will you nullpointer exception for the input:
2
1 2
2
https://ide.codingblocks.com/s/197051 here is the correct code. I have commented the lines I have added. Kindly have a look.