Day 1 (fixed part 2 #2)
This commit is contained in:
@@ -5,7 +5,7 @@ items = [int(x.strip()) for x in open("input.txt")]
|
|||||||
|
|
||||||
COUNT = 3
|
COUNT = 3
|
||||||
|
|
||||||
for vals in combinations(items, 3):
|
for vals in combinations(items, COUNT):
|
||||||
if sum(vals) == 2020:
|
if sum(vals) == 2020:
|
||||||
print("Found [{}]: Sum={}, Product={}".format(
|
print("Found [{}]: Sum={}, Product={}".format(
|
||||||
", ".join(map(str, vals)),
|
", ".join(map(str, vals)),
|
||||||
|
|||||||
Reference in New Issue
Block a user