def test_flip(): s = Stack.from_str('++--+-') assert s == [True, True, False, False, True, False] assert str(s) == '++--+-' s.flip(2) assert str(s) == '----+-'
def test_regular(): s = Stack.from_str('--+-') n = s.solve_regular() assert str(s) == '++++' assert n == 3