I dont know what i'm missing!

The code seems good to me and even better optimized than the one told in the hint video but still, I’m getting run error on most of the test cases.

@Enigmatctrance for k>n do k=k%n and for k==n print linklist as it is