示例#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) == '----+-'
示例#2
0
def test_regular():
    s = Stack.from_str('--+-')
    n = s.solve_regular()
    assert str(s) == '++++'
    assert n == 3