Program not getting sucessful in all testcases

Program not getting sucessful in all testcases, but on my pc it’s working for all manually supplied testcases.
Please check

hello @Kolhar_Prashant
this might be issue. image

instead use
while(front < rear):
logic
this will remove the extra logic that u used to end the loop.

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.