Https://ide.codingblocks.com/s/235604

why this is not running on last query of this test case although when run as a separate test case the last query runs perfectly.

5 1 2 3 4 5 5 1 4 1 1 5 2 1 5 3 1 5 4 1 5 5 is the test case

@Adarshrajpandey
I checked your code and test case and it runs perfectly
What exactly was not right here ?

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.