diff --git a/day22.py b/day22.py index 16ff6e3..04e4693 100644 --- a/day22.py +++ b/day22.py @@ -59,11 +59,21 @@ class Day(AOCDay): def part1(self) -> Any: dropped_bricks, _ = drop(self.parse_input()) - return sum(c[1] == 0 for c in (drop(dropped_bricks - {x}) for x in dropped_bricks)) + count = 0 + for brick in dropped_bricks: + _, c = drop(dropped_bricks - {brick}) + count += c == 0 + self.progress(len(dropped_bricks)) + return count def part2(self) -> Any: dropped_bricks, _ = drop(self.parse_input()) - return sum(c[1] for c in (drop(dropped_bricks - {x}) for x in dropped_bricks)) + count = 0 + for brick in dropped_bricks: + _, c = drop(dropped_bricks - {brick}) + count += c + self.progress(len(dropped_bricks)) + return count if __name__ == "__main__":