Few testcases not working

The code is in the link below -

so the question stated that k > n ( size of linked list)
after line 77 update the code as follows:

k%=n;
if(k!=   0 )
{
head=app(head,k);
}

what we are doing is reducing k so that reaches range of linked list
and if k != 0 then we have the function call

Thanks that change in the code worked.

1 Like