Some test cases failing kindly look into the code

some of my test cases are failing kindly tell me the mistake in my code

Hello @av8055 check now:

can you please tell the changes

I got the changes but can you explain why we have done k = k%n

@av8055 because it is mentioned that k can be greater then n also.

but if k>n doesn’t that mean we have to do nothing and return because if k > n the result would be same

let suppose if n is 5 and k is 7 then after doung k=k%n;
k will be 2. so we will append the last 2 elements.

like what is the meaning of appending 50 elements when total elements of the list are only 10

@av8055 no this means that you have to append the elements after taking modulo.
it is just the one trick in question to pass all the test cases.

if the number is out of range then we have to take modulus and then the answer always come in this range only.