import os import itertools inputfile = os.path.join(os.path.dirname(__file__), "input/day01_input") with open(inputfile) as file: lines = [int(line.strip()) for line in file] def test_day1a(): list_permutations = itertools.combinations(lines, 2) for (a, b) in list_permutations: if a + b == 2020: result = a * b assert result == 514579 def test_day1b(): list_permutations = itertools.combinations(lines, 3) for (a, b, c) in list_permutations: if a + b + c == 2020: result = a * b * c assert result == 241861950