Day 19 solution

I had some trouble with the logic of this puzzle in my head, and the visuals were too large to realistically render for me to spot-check my solution, so I kept getting part 2 wrong. I eventually realized what needed to be done to get the right answer, which was partially the realization that I needed to check +99 instead of +100, and partially that I probably didn't need to check the entire space, just the bounding points, at least for the initial filters.

And then I optimized it with a bisect instead of a linear search. Always a good idea when you need to narrow a large range to a single point.
This commit is contained in:
2022-07-13 08:40:48 -05:00
parent 4db2d11401
commit f9f31820ac
3 changed files with 148 additions and 0 deletions

View File

@ -52,6 +52,7 @@ var dayMap = []day{
&days.Day16{},
&days.Day17{},
&days.Day18{},
&days.Day19{},
}
func main() {