Not able to pass 1 testcase
hello @Ak07
your code is not mainting relative ordering.
for ex->
4
1 2 8 3 (note 2 comes before 8 so in output same relative order should be there)
correct output -> 1 3 2 8
urs output -> 1 2 8 2
how do I maintain this relative ordering?
maintain two separate lists.
one for odd and one for even.
iterate the give list from start to end,
if current data is even add to the tail of even otherwise add to the tail of odd.
once done with iteration.
add even list to the tail of odd list and then return the head of odd lsit.