diff --git a/day01/part2.py b/day01/part2.py index 6a82be5..48676b0 100644 --- a/day01/part2.py +++ b/day01/part2.py @@ -6,9 +6,8 @@ last = [float('inf')] * 3 cnt = 0 for line in lines: - nxt = last[1:] + [line] - if sum(last) < sum(nxt): + if last[0] < line: cnt += 1 - last = nxt + last = last[1:] + [line] print(cnt) \ No newline at end of file