Problem in the code


please tell where is the problem in the code
it is giving right output for the given testcase

hi @himanshuanand729 print newline after every test case

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.

Please refer the code and resolve the problem

u r getting tle or mle then do insertion in o(1) u r doing insertion in o(n) @himanshuanand729