Advent of Code 2019 - Day 20

Note: This topic is to talk about Day 20 of the Advent of Code 2019.

There is a private leaderboard for elixirforum members. You can join it by following this link and entering the following code:


This was a fun one! Here is my solution.

I found today a bit finicky. Here’s my solution. Takes about 2 seconds for part 2.

1 Like

I’ve been stuck on part 1 so far where the two examples they gave work, but it tells me I’m too low on my final answer on mine.
… this hasn’t been the easiest one to debug when you just know that you’re too low.

Some users on reddit had the same problem. Here is a reddit thread with a hint.

Nah, I believe I was careful with label order. I’ve been looking at found an issue with my labels and skipping, which I fixed to work the first example, but now fails the second…

I’ve ended up doing the second example by hand (twice!), and agreed with my code in a way that disagreed with their map. I then put my input for part 1 in the box and it passed.

So the way I counted things didn’t match the second example that can reach AA -> ZZ in 58 steps, it did it in 59, same as my code. I’m still not too sure what was going on, but I’ll try the rest later for part 2.

1 Like

Finally found the time to finish it. It works fine but most of my issues required a huge huge amount of time to debug because I expected them to be with the procedural parts of the BFS and turned out to be minor errors or inconsistencies across the formatting of input maps that turned out to create wildly different behaviours across runs.

It’s almost 3 hours long; I post the video for completeness, not because anyone should lose that much time watching it.