Initialize prefix arrays to store number of changes required to put 1 s at either even or odd position
int oddone [ n + 1 ] ; int evenone [ n + 1 ] ; oddone [ 0 ] = 0 ; evenone [ 0 ] = 0 ; for ( int i = 0 ; i < n ; i ++ ) {