Cant pass 3 test cases

Cant figure out why other cases are not passing, need a hint

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