Fixed readme links

This commit is contained in:
Stefan Müller 2025-01-22 20:42:47 +01:00
parent 21279a97a6
commit d2e64d2518
1 changed files with 9 additions and 9 deletions

View File

@ -16,43 +16,43 @@ The solution contains a unit test project to help troubleshoot issues and preven
### Day 1: Historian Hysteria
:mag_right: Puzzle: <https://adventofcode.com/2024/day/1>, :white_check_mark: Solver: [`HistorianHysteria.cpp`](AdventOfCode2024/HistorianHysteria.cpp)
:mag_right: Puzzle: <https://adventofcode.com/2024/day/1>, :white_check_mark: Solver: [`HistorianHysteria.cpp`](src/HistorianHysteria.cpp)
I'm using a `std::multiset` to collect and sort the values for both lists. This allows to use a single iteration of the left list and two iterations of the right list simultaneously to solve both parts. Nice application of iterators.
### Day 2: Red-Nosed Reports
:mag_right: Puzzle: <https://adventofcode.com/2024/day/2>, :white_check_mark: Solver: [`RedNosedReports.cpp`](AdventOfCode2024/RedNosedReports.cpp)
:mag_right: Puzzle: <https://adventofcode.com/2024/day/2>, :white_check_mark: Solver: [`RedNosedReports.cpp`](src/RedNosedReports.cpp)
Here, we have a few conditionals to determine on the fly which of the numbers would make the report safe if dropped. The amount of cases is actually quite manageable.
### Day 3: Mull It Over
:mag_right: Puzzle: <https://adventofcode.com/2024/day/3>, :white_check_mark: Solver: [`MullItOver.cpp`](AdventOfCode2024/MullItOver.cpp)
:mag_right: Puzzle: <https://adventofcode.com/2024/day/3>, :white_check_mark: Solver: [`MullItOver.cpp`](src/MullItOver.cpp)
A simple [finite state machine](AdventOfCode2024/StringStateMachine.h) crawling along the input character by character solves both parts nicely. The algorithm tracks whether `mul` instructions are enabled or not, but ignores this setting for part 1.
A simple [finite state machine](include/aoc/StringStateMachine.hpp) crawling along the input character by character solves both parts nicely. The algorithm tracks whether `mul` instructions are enabled or not, but ignores this setting for part 1.
### Day 4: Ceres Search
:mag_right: Puzzle: <https://adventofcode.com/2024/day/4>, :white_check_mark: Solver: [`CeresSearch.cpp`](AdventOfCode2024/CeresSearch.cpp)
:mag_right: Puzzle: <https://adventofcode.com/2024/day/4>, :white_check_mark: Solver: [`CeresSearch.cpp`](src/CeresSearch.cpp)
For this puzzle I added a class for [points in two-dimensional space](AdventOfCode2024/Point2.h), so I can use these for simplifying directional computations. With that, the algorithm looks for all `X` and `A` for part 1 and 2, respectively, and tries to find the remaining characters, starting from that `X` or `A`.
For this puzzle I added a class for [points in two-dimensional space](include/aoc/Point2.hpp), so I can use these for simplifying directional computations. With that, the algorithm looks for all `X` and `A` for part 1 and 2, respectively, and tries to find the remaining characters, starting from that `X` or `A`.
### Day 5: Print Queue
:mag_right: Puzzle: <https://adventofcode.com/2024/day/5>, :white_check_mark: Solver: [`PrintQueue.cpp`](AdventOfCode2024/PrintQueue.cpp)
:mag_right: Puzzle: <https://adventofcode.com/2024/day/5>, :white_check_mark: Solver: [`PrintQueue.cpp`](src/PrintQueue.cpp)
My implementation uses an ordering matrix (a two-dimensional boolean array) to track which page combinations are ordered, and then queries that matrix for each ordered combination of pages in a single line. The same matrix can then also be used for a custom sort function for part 2.
### Day 10: Hoof It
:mag_right: Puzzle: <https://adventofcode.com/2024/day/10>, :white_check_mark: Solver: [`HoofIt.cpp`](AdventOfCode2024/HoofIt.cpp)
:mag_right: Puzzle: <https://adventofcode.com/2024/day/10>, :white_check_mark: Solver: [`HoofIt.cpp`](src/HoofIt.cpp)
The algorithm starts at the trail ends (the `9`'s) and searches all options from there downwards until trailheads are reached. For each visited map location, it tracks unique reachable end points (for part 1) and number of possible paths to end points (for part 2). These values are accumulated, if during the search the same map location is encountered again.
### Day 11: Plutonian Pebbles
:mag_right: Puzzle: <https://adventofcode.com/2024/day/11>, :white_check_mark: Solver: [`PlutonianPebbles.cpp`](AdventOfCode2024/PlutonianPebbles.cpp)
:mag_right: Puzzle: <https://adventofcode.com/2024/day/11>, :white_check_mark: Solver: [`PlutonianPebbles.cpp`](src/PlutonianPebbles.cpp)
Since the order of the pebbles does not actually matter, we can simply blink from one line of pebbles to the next and count only cardinalities of each number in the current line.