param { number [ ] } arr return { number [ ] } function ReorderOddEven ( arr ) { if ( arr . length < 2 ) { return arr ; } let left = 0 ; let right = arr . length - 1 ; while ( left < right ) { while ( arr [ left ] % 2 !== 0 && left < right ) { left ++ ; } while ( arr [ right ] % 2 === 0 && right > left ) { right -- ; } [ arr [ left ] , arr [ right ] ] = [ arr [ right ] , arr [ left ] ] ; } return arr ; } export { ReorderOddEven } ;