This is failing for 1 1 2 3 4

ans should be 1 2 1 4 3
but getting 1 1 3 2 4

hello @talhashamim001

pls share ur code with me

even this is correct .
the elements can be equal
arr[0] >= arr[1] <= arr[2] >= arr[3] <= arr[4] >=

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.