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

plz check why 2 test casses are failing

Hello @asinghal1_be19 your code is giving error because your are not maintaining the relative order :
4
1 2 4 5
the ouput should be :
1 5 2 4
but your ouput is different:
Happy Learning!!

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.