12
๐โโ๏ธ - 2024 DAY 20 SOLUTIONS -๐โโ๏ธ
(programming.dev)
An unofficial home for the advent of code community on programming.dev!
Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
Solution Threads
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 |
Icon base by Lorc under CC BY 3.0 with modifications to add a gradient
console.log('Hello World')
Haskell
~~I should probably do something about the n^2^ loop in
findCheats
, but it's fast enough for now. Besides, my brain has melted.~~ Somewhat better (0.575s). Can't shake the feeling that I'm missing an obvious closed-form solution, though.Ah, the number of potential start points is much smaller than the length of the path. I guess a map from position to offset would do it, but I'm not sure it's really worth it.