bjorng
Advent of Code - Day 22
Note: This topic is to talk about Day 21 of the Advent of Code.
For general discussion about the Advent of Code 2018 and links to topics of the other days, see this topic.
Most Liked
bjorng
Here is my solution for Day 22.
I finished part 1 one quickly.
Embarrassingly, I then spent a lot of time on part 2, only to discover that I had a bug in the erosion level calculation. Despite the bug, I got the correct result for both the example and my input for part 1.
When I had fixed the erosion calculation bug, my code for finding the fastest path worked the first time I tried running on the example.
Then, of course, it didn’t finish running on the real input data. I then added a heuristic to prune paths that couldn’t possibly be faster than the already found path.
With that final fix, my program finished in about one and a half minutes.







