AoC# 2024 - Day 8: Resonant Collinearity
It’s Advent of Code time 🎄
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill levels that can be solved in any programming language you like.
I’m happy with my Day 8 solution 🙂
Part 1 ⭐️
I started by creating a Dictionary<char, List<Point>>
to group all of the antennae by type (char
), then looped over each type in turn finding pairs and extrapolating the next location by applying the difference of their coordinates. A quick check that the new coordinates were within the map bounds and I had the answer.
Part 2 ⭐️
Extending the difference of coordinates repeatedly until they’re outside the map bounds called for a while (IsWithinMap(potentialAntinode)) { ... }
loop.
Calendar…
I love how the calendar ASCII art follows the narative of the puzzle journey, could this year’s be a milestone celebration… 🎂❓