ive attached the full code for your reference, as you can see it dosent work for some test cases. Should i put a while condition for the cases where k exceeds the size of the list?
The code provided in the editorial is wrong
@vipulch this is the code provided in the editorial https://ide.codingblocks.com/s/608982 and its working fine.
can you please help me understand why it isnt working in my case? ive basically copied and pasted that function but it still dosent work
ohh i just saw, you made a change in the main function where it uses modulus to reduce the k under size, that was exactly my question when i asked if we need to do that. I guess this is the only way to make it work,thank you
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.