Test cases Error

only two test cases are not passing .

since after n appendings linked list returns to its original state, after taking input k replace it with k%n
Corrected code

Okay done…Thank you!