示例#1
0
def test_difficulty():
    pi = Pi()
    assert pi.score('333') == 1
    assert pi.score('5555') == 1

    assert pi.score('23456') == 2
    assert pi.score('3210') == 2

    assert pi.score('323') == 4
    assert pi.score('54545') == 4

    assert pi.score('147') == 5
    assert pi.score('8642') == 5
示例#2
0
def test_ex5():
    pi = Pi()
    pi.string = '12673939'
    assert pi.solve(0) == 14
示例#3
0
def test_ex4():
    pi = Pi()
    pi.string = '22222222'
    assert pi.solve(0) == 2
示例#4
0
def test_ex3():
    pi = Pi()
    pi.string = '12122222'
    assert pi.solve(0) == 5
示例#5
0
def test_ex2():
    pi = Pi()
    pi.string = '11111222'
    assert pi.solve(0) == 2
示例#6
0
def test_combinations():
    pi = Pi()
    pi.dfs([], 8)
    pi.dfs([], 10)
    pi.dfs([], 12)
示例#7
0
def test_ex1():
    pi = Pi()
    pi.string = '12341234'
    assert pi.solve(0) == 4