15 lines
321 B
Python
15 lines
321 B
Python
import math
|
|
from itertools import combinations
|
|
|
|
items = [int(x.strip()) for x in open("input.txt")]
|
|
|
|
COUNT = 3
|
|
|
|
for vals in combinations(items, 3):
|
|
if sum(vals) == 2020:
|
|
print("Found {} and {} and {}: Sum={} Product={}".format(
|
|
*vals,
|
|
sum(vals),
|
|
math.prod(vals)
|
|
))
|