Failing 2 test cases

I dont understand why two of my test cases failed, can you please look into my code and tell me

@KushagraNITJ smaller element should come before larger
for sample case your output 1 and 4 3 and 2 but it should be 2 and 3 check it

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.