diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-04 06:34:16 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-04 06:34:16 +0100 |
| commit | bc79fa83d3cb63d8445312b47dbed9295809b28a (patch) | |
| tree | 31302da9489e25df417d3ffd88c6f69a8ccf2745 /2025/README.md | |
| parent | 31c9f59a5f8946e8d90f2aad96e065ab4b496b67 (diff) | |
| download | aoc-bc79fa83d3cb63d8445312b47dbed9295809b28a.tar.gz aoc-bc79fa83d3cb63d8445312b47dbed9295809b28a.zip | |
Day 4 2025
Diffstat (limited to '2025/README.md')
| -rw-r--r-- | 2025/README.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/2025/README.md b/2025/README.md index c72c8a5..8fccef4 100644 --- a/2025/README.md +++ b/2025/README.md | |||
| @@ -11,6 +11,7 @@ Example | |||
| 11 | 11 | ||
| 12 | ``` | 12 | ``` |
| 13 | Day -Part 1- -Part 2- | 13 | Day -Part 1- -Part 2- |
| 14 | 4 00:25:36 00:27:49 | ||
| 14 | 3 00:05:02 00:16:09 | 15 | 3 00:05:02 00:16:09 |
| 15 | 2 00:10:36 00:11:55 | 16 | 2 00:10:36 00:11:55 |
| 16 | 1 00:06:20 00:50:41 | 17 | 1 00:06:20 00:50:41 |
| @@ -49,3 +50,14 @@ For part 2 I used recursion with memorization (using Python's | |||
| 49 | `functools.cache`), which is fast enough. But later Chiara pointed | 50 | `functools.cache`), which is fast enough. But later Chiara pointed |
| 50 | out to me that actually the solution is quite trivially greedy; I | 51 | out to me that actually the solution is quite trivially greedy; I |
| 51 | implemented the greedy version in `b-alt.py`. | 52 | implemented the greedy version in `b-alt.py`. |
| 53 | |||
| 54 | ### Day 4: Printing Department | ||
| 55 | |||
| 56 | The first "map" problem of the year! This one was easy, but I | ||
| 57 | made a lot of mistakes in part 1. I decided to use the trick that | ||
| 58 | [Jared](https://guissmo.com) suggested a couple of years ago: extend the | ||
| 59 | map by 1 cell in all directions so you don't have to deal with indices | ||
| 60 | out of bounds. | ||
| 61 | |||
| 62 | For part 2 I decided to quickly code the dumb "repeat part 1 until no | ||
| 63 | rolls are removed" strategy and it worked. | ||
