Linked List - K append

whats wrong in my code, its failing two test cases

You havent checked for the cases, if k is greater than n, so use this linde of code in your main function for the same conditions as ,
k=k%N;
if(k==0)
{
print(head);
}
else
{
head=append_nodes(head,k);
print(head);
}

okay its working now thank u