Please correct the code

Its not passing 3 test cases

For k=n print linked list as it is and for k>n do k=k%n;
It was not mentioned in the question but it is according to the test cases.