To do two way sort . Make comparator function for the inbuilt sort function of c ++ such that odd numbers are placed before even in descending and ascending order respectively
function compare ( a , b ) {