Getting one test case wrong

i am not able to find why in last test case getting wrong answer

Hello @Manish-Sahani-1732882830153569,

Your Code is failing for the test cases like:
Example 1:
7
1 2 4 3 8 5 6
Your Output:
1 3 5 2 4 6 8
Expected Output:
1 3 5 2 4 8 6

Example 2:
10
1 2 3 4 5 6 7 8 9 10
Your Output:
1 3 5 7 9 10 8 6 4 2
Expected Output:
1 3 5 7 9 2 4 6 8 10

Mistake:
The order in the even sequence should be the same as present in the original input sequence.

Try to correct it.
Let me know, if you face any issue.
Hope, this would help.
Give a like if you are satisfied.

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.