Kappend linked list


3 test cases passed…1 test case failed…it is showing runerror…whats wrong in my code??

Hello Amisha
Just a small edge case that you missed, in kappend function, add:
//return head if k=n or k%n==0
if(k==0)
return head;
After you do k=k%n;
And the remaining test case will pass.

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.