Place the ones on alternate places in the answer array , leaving spaces for zeros remainder elements in the array
for ( i = 1 , j = 0 ; j < c_1 ; i += 2 , j ++ ) { ans [ i ] = ones . top ( ) ; ones . pop ( ) ; }