Cannot find the error in code

in the question “linked list k append”, my code is showing error. please tell the mistake in my code.
code: https://ide.codingblocks.com/s/105225

hi shantanu i think your approach for the question is not correct.
can you please explain your logic

i have commented the same code of mine to explain how i wanted it to work. i tried to move head to place after (N-n) element and join end to head(using temp).

i will check your code

your logic seems to be correct. but it is too slow for the test cases so it is giving TLE.
try optimizing it or thinking of something else

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.