diff --git a/2020/day01-expense.py b/2020/day01-expense.py index c16da5a..471d5fd 100644 --- a/2020/day01-expense.py +++ b/2020/day01-expense.py @@ -8,9 +8,11 @@ def main(): for i, value in enumerate(lines): for j in range(i+1, stop): other = lines[j] - addition = other + value - if addition == 2020: - print("result is", other * value) + for k in range(j+1, stop): + third = lines[k] + addition = other + value + third + if addition == 2020: + print("result is", other * value * third) if __name__ == '__main__':