My code doenst satify 3 test cases, but it works well on all kind of input ,, please check

hello @nmoudgil_be19 you are not doing in the correct way .
your code is falling for the test case :
4
1 2 3 4
5
your output is different from the expected output .
try to do this with the help of linked list proper implementation .
i hope i have cleared your doubt .
Happy Learning!!

dude thats the prob i dont understood what should i do when k > n

plss help :grinning:

@nmoudgil_be19 then you should have asked your question in that way .
anyway ,if k>n then take do k%n.
for example in the above case if you can see .
k=5 and n=4
if you do k%n then 5%4 will be 1 then you have to k append for this and the output will 4123.

i hope i have cleared your doubt .
Happy Learning !!

thanks a lot bro!!! :slightly_smiling_face:

hello @nmoudgil_be19 as you are not responding to the doubt which you have raised a month ago i think that your doubt is cleared now . you can now mark this doubt as resolved.
on off the chance if you still have doubt you can reopen it and ask again .
Happy Learning !!

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.