Odd even using recursion a problem on hackerblocks


it is failing at one test case.
Example:
we have to print odds in decreasing order upto 1 and then in increasing order of even numbers
input 5
output 5 3 1 2 4

please share hackerblock link of the question

but what is wrong with my logic?

not workign fine for even number