generated from public/aoc_template
day8 - use the tools, luke
This commit is contained in:
parent
ad7d5e47f7
commit
4e749b6fdd
3
day08.py
3
day08.py
@ -1,5 +1,6 @@
|
||||
from itertools import combinations
|
||||
from tools.aoc import AOCDay
|
||||
from tools.tools import minmax
|
||||
from typing import Any
|
||||
from tools.grid import Grid
|
||||
|
||||
@ -15,7 +16,7 @@ def get_antinode_count(grid: Grid, repeat: bool = False) -> int:
|
||||
antinodes |= antennas
|
||||
|
||||
for pair in combinations(antennas, 2):
|
||||
a, b = (pair[0], pair[1]) if pair[0] < pair[1] else (pair[1], pair[0])
|
||||
a, b = minmax(*pair)
|
||||
diff = b - a
|
||||
|
||||
while grid.isWithinBoundaries(a - diff):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user