I have submitted the code but have a trouble

sir ,
for the test case:
9 3
9 4 1 7 8 3 2 6

Output
1 4 9 3 8 7 6 6 2

As you can see 6 is repeating twice …because n is not a multiple of k in this case , but i have cleared all the test cases for this question .
I am not getting what is wrong in my code ,could you please help

you have passed all the test case because
in question it is mention that
" Assume k is a factor of the size of List."

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.