Exemplo n.º 1
0
def test_flip():
    s = Stack.from_str('++--+-')
    assert s == [True, True, False, False, True, False]
    assert str(s) == '++--+-'

    s.flip(2)
    assert str(s) == '----+-'
Exemplo n.º 2
0
def test_regular():
    s = Stack.from_str('--+-')
    n = s.solve_regular()
    assert str(s) == '++++'
    assert n == 3