aoc2020/day01.py
2020-12-01 11:27:01 +01:00

19 lines
429 B
Python

import aoclib
if 'TEST' not in globals():
TEST = False
my_input = aoclib.getInputLineAsArray(day=1, return_type=int, test=TEST)
globalBreak = False
while len(my_input) > 0:
try_value = my_input.pop()
for value in my_input:
if try_value + value == 2020:
aoclib.printSolution(1, 1, try_value * value, test=TEST)
globalBreak = True
break
if globalBreak:
break