2020: d01: ex1: add solution

This commit is contained in:
Bruno BELANYI 2020-12-01 16:36:39 +01:00
parent bf6e173b68
commit ec41d05389

17
2020/d01/ex1/ex1.py Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env python
import functools
import itertools
import operator
import sys
def main() -> None:
values = [int(n) for n in sys.stdin.readlines()]
for tup in itertools.combinations(values, 2):
if sum(tup) == 2020:
print(functools.reduce(operator.mul, tup))
break
if __name__ == "__main__":
main()