adventofcode-2020/01/part2

14 lines
501 B
Python
Executable File

#!/usr/bin/python3
expenses = []
with open("input") as fh:
for ln in fh:
expenses.append(int(ln))
for i in range(len(expenses)):
for j in range(i + 1, len(expenses)):
for k in range(j + 1, len(expenses)):
if expenses[i] + expenses[j] + expenses[k] == 2020:
print(expenses[i], expenses[j], expenses[k],
"sum = ", expenses[i] + expenses[j] + expenses[k],
"mul = ", expenses[i] * expenses[j] * expenses[k])