Created
December 1, 2020 20:14
-
-
Save rtt/0896a65030311ce825001c77882dca08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import combinations | |
from functools import reduce | |
from operator import mul | |
def get_input(): | |
with open('1.txt') as f: | |
inp = f.readlines() | |
return list(map(int, map(str.strip, filter(None, inp)))) | |
nums = list([c for c in combinations(get_input(), 3) if sum(c) == 2020][0]) | |
print(reduce(mul, nums), nums) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment