From abe1fc15320478868c49b1f4c296a8b0a0e208dc Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Wed, 1 Dec 2021 07:05:50 +0100 Subject: [PATCH] day01: and p1 is the same as p2, btw ... --- day01.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/day01.py b/day01.py index 6dda502..ec5df61 100644 --- a/day01.py +++ b/day01.py @@ -8,11 +8,8 @@ class Day(AOCDay): def part1(self): count = 0 depths = self.getInputListAsType(int) - for i, x in enumerate(depths): - if i == 0: - continue - - if x > depths[i-1]: + for x in range(1, len(depths)): + if depths[x] > depths[x-1]: count += 1 return count