generated from public/aoc_template
Day 22 - make use of new progress bar feature
This commit is contained in:
parent
67a278ce0c
commit
b053e244e4
14
day22.py
14
day22.py
@ -59,11 +59,21 @@ class Day(AOCDay):
|
|||||||
|
|
||||||
def part1(self) -> Any:
|
def part1(self) -> Any:
|
||||||
dropped_bricks, _ = drop(self.parse_input())
|
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:
|
def part2(self) -> Any:
|
||||||
dropped_bricks, _ = drop(self.parse_input())
|
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__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user