Append last K node all testcases are not passed

I have thoroughly checked the code and even the input and output of the testcase given in the question output are matching but still testcase is not passed. Here is my code -

@ak_99 actually it is not mentioned in the question what you have to do for k>=n here-
for k==n print linklist as it is
for k>n k=k%n
i hope its cleared if yes dont forget to mark it as resolved :smiley:

That is fine but i have checked output of my solution and output given in Editorial even after it is testcase is not passed !!

@ak_99 i did these 2 conditions in your code and it passes all the test cases so implement these 2 cases

just do k=k%n after inputting it and if k==0 print link list as it is

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.