Even-After-Odd Problem

Why is test case 3 giving run error ?

https://ide.codingblocks.com/s/279326 Why is test case 3 giving run error ?

https://ide.codingblocks.com/s/279326 Why is test case 3 giving run error ?

You code is failing when there is no even node.
Dry run and check with this case:
4
1 3 3 1

Thanks for helping… :relaxed: