Merge remote-tracking branch 'origin/main'

This commit is contained in:
Stefan Harmuth 2024-01-01 21:35:26 +01:00
commit 7595fa8562
2 changed files with 1226 additions and 6 deletions

View File

@ -1,7 +1,6 @@
from __future__ import annotations
from collections import deque
from tools.aoc import AOCDay
from tools.itertools import len_permutations
from typing import Any
@ -61,7 +60,11 @@ class Wiring:
connections = set()
for component in self.components.values():
for connection in component.connections:
connections.add((component.name, connection.name) if component.name < connection.name else (connection.name, component.name))
connections.add(
(component.name, connection.name)
if component.name < connection.name
else (connection.name, component.name)
)
return connections
@ -85,11 +88,12 @@ class Day(AOCDay):
inputs = [
[
# (54, "input25_test"), # Test breaks sometimes. Live always works?!
(545528, "input25_dennis"),
(544523, "input25"),
],
[
(None, "input25"),
]
],
]
def part1(self) -> Any:
@ -114,6 +118,6 @@ class Day(AOCDay):
return ""
if __name__ == '__main__':
if __name__ == "__main__":
day = Day(2023, 25)
day.run(verbose=True)

1216
inputs/input25_dennis Normal file

File diff suppressed because it is too large Load Diff