Day 9 (added print)
This commit is contained in:
@@ -5,12 +5,11 @@ lines = (int(x.strip()) for x in open("input.txt"))
|
|||||||
L = 25
|
L = 25
|
||||||
|
|
||||||
buffer = deque(maxlen=L)
|
buffer = deque(maxlen=L)
|
||||||
result = None
|
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if len(buffer) == L:
|
if len(buffer) == L:
|
||||||
found = any(a + b == line for a, b in combinations(buffer, 2))
|
found = any(a + b == line for a, b in combinations(buffer, 2))
|
||||||
if not found:
|
if not found:
|
||||||
result = line
|
print(line)
|
||||||
break
|
break
|
||||||
buffer.append(line)
|
buffer.append(line)
|
||||||
|
|||||||
Reference in New Issue
Block a user