What would be the answer when k>n, should it not remain the same?

On k>n, should it not be that the list is returned as it was initially when input.

hello @gargprachi1203
convert k < n by doing
k=k%n
and then apply ur logic

what is the logic behind this?

for k=n u will get same list
so k=n+1 is same as k=1
k=n+2 is same as k=2
thats why k=k%n

okay, thank you, this clarified my doubt :slight_smile:

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.