From 7693c64037fcd962703ab1f4dfd1a940e4ed7d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BCller?= Date: Mon, 2 Dec 2024 11:08:38 +0100 Subject: [PATCH] Update readme --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3e076d..42536f0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,24 @@ # AdventOfCode2024 -Solver for Advent of Code 2024 puzzles. https://adventofcode.com/2024/ +Solver for Advent of Code 2024 puzzles. + +This is a single command line application for the puzzles written in [C++17](https://en.cppreference.com/w/cpp/17) with [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) (v143). + +## Puzzle Input + +This project does not contain the puzzle or example inputs as per the [copyright notice of Advent of Code](https://adventofcode.com/about). In order to run the compiled application, the puzzle inputs have to be downloaded from the [Advent of Code 2024](https://adventofcode.com/2024/) puzzle pages, and placed as text files into the `AdventOfCode2024\data` directory, e.g. `AdventOfCode2024\data\historian_hysteria.txt`, or `AdventOfCode2024\data\example\historian_hysteria.txt` for the unit tests. The application will output an error message with details if it cannot find an input file. + +## Tests + +The solution contains a unit test project to help troubleshoot issues and prevent regressions in the solver class framework. These tests cover the solutions for provided examples and full data inputs. I did not find a definitive source for it, but the full data inputs seem to be user-specific, so adding my solutions as tests does not spoil the solutions. + +## Solutions + +### Day 1: Historian Hysteria + +:mag_right: Puzzle: , :white_check_mark: Solver: [`HistorianHysteria.cpp`](AdventOfCode2024/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. ## License