Day 01 (be more clever)
This commit is contained in:
@@ -6,9 +6,8 @@ last = [float('inf')] * 3
|
|||||||
cnt = 0
|
cnt = 0
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
nxt = last[1:] + [line]
|
if last[0] < line:
|
||||||
if sum(last) < sum(nxt):
|
|
||||||
cnt += 1
|
cnt += 1
|
||||||
last = nxt
|
last = last[1:] + [line]
|
||||||
|
|
||||||
print(cnt)
|
print(cnt)
|
||||||
Reference in New Issue
Block a user