adventofcode-2020/01/solve02.py

13 lines
236 B
Python
Raw Normal View History

2021-12-13 07:59:07 +01:00
#!/usr/bin/env python
from itertools import permutations
report = []
with open("input01.txt","r") as f:
report = [int(i) for i in f.readlines()]
for p in permutations(report, 3):
if sum(p) == 2020:
print(p[0]*p[1]*p[2])
break;