Even After Odd Problem

Hi, I try to solve this problem, Using STL , One test case is getting failed. Please advise.

your approach is not correct
you need not to sort the list
it will change the order and lead to wrong answer
to see the correct way check out modified code

Modified Code

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.