Linked List-K Append

Can you tell or correct my code, it is not passing three test cases. I think it is not passing for case when k>=n https://ide.codingblocks.com/s/173818

Hi @yath17
You code is failing for test cases where k>n. So in order to do it correct for those cases you have to just take k=k%n; before passing it to the append function. And also call for the function only if k>0 because when k=0 then no need to call the append function.

Here is your corrected code :

If your doubt is clear then mark it as resolved.