adventofcode-2020/01/part2

14 lines
501 B
Plaintext
Raw Permalink Normal View History

2020-12-12 12:58:51 +01:00
#!/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])