Place the ones on alternate places in the answer array , leaving spaces for zeros remainder elements in the array
i , j = 1 , 0 NEW_LINE while ( j < c_1 ) : NEW_LINE INDENT ans [ i ] = ones [ - 1 ] NEW_LINE ones . pop ( ) NEW_LINE i += 2 NEW_LINE j += 1 NEW_LINE DEDENT