adventofcode-2020/09/part1

17 lines
347 B
Python
Executable File

#!/usr/bin/python3
code = []
with open("input") as fh:
for ln in fh:
code.append(int(ln))
def valid(code, o):
for i in range(o - 25, o - 1):
for j in range(i, o):
if code[i] + code[j] == code[o]:
return True
for o in range(25, len(code)):
if not valid(code, o):
print(o, code[o])