What's wrong in my code

I am not able to figure out what is wrong in this code.
it is giving right output for the available test case

you can check my code here:-

Whenever you get a query, pop k-1 elements temporarily and give the answer!

For this implementation, you can have a look at this very simple and easy code here.

okkkkkkkkkkkkkkkkkkkkk.

You may close the doubt if resolved. Please give a rating :relaxed:

1 Like