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