DEV Community

loading...

Discussion on: Advent of Code 2020 Solution Megathread - Day 1: Report Repair

Collapse
pihentagy profile image
pihentagy

Python, why make it complicate if it is so siple?

for (a,b) in itertools.combinations([int(n) for n in open('input')], 2): 
    if a+b == 2020: 
        print(a*b) 
Enter fullscreen mode Exit fullscreen mode