Esempio n. 1
0
def euler_problem67():
    triangle = []
    with open('triangle.txt') as f:
        input = f.read()
    for line in input.splitlines():
        triangle.append([int(x) for x in line.split()])
    return euler.traverse_triangle_max_sum(triangle)
Esempio n. 2
0
 def test_max_triangle_traverse(self):
     self.assertEqual(23, euler.traverse_triangle_max_sum([[3], [7, 4], [2, 4, 6], [8, 5, 9, 3]]))
Esempio n. 3
0
def euler_problem18():
    triangle = []
    for line in input.splitlines():
        triangle.append([int(x) for x in line.split()])
    return euler.traverse_triangle_max_sum(triangle)