Regarding odd even concept

kindly please checck my code

you approach is correct which i have seen from your submission Your code

but the problem is order in which output shown
you have change the output which is not correct

for input
7
1 2 4 3 8 5 6
correct output
1 3 5 2 4 8 6

now think and try again

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.