adventofcode-2020/09/part1

17 lines
347 B
Plaintext
Raw Normal View History

2020-12-13 19:18:42 +01:00
#!/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])