Skip to content

The Advent of Code 2022 Day 16: busy times

Posted in Advent of Code

It’s been a whole two weeks since my last entry for Day 21, just before I headed to Paris. Funnily enough, I did the first part of Day 22 on the outbound Eurostar. I was pretty optimistic about it but dropped part two when I noticed I needed to do some paper craft. Since I missed the December 25th date to hit all the stars, I decided to gto the earliest days I hadn’t completed this year. Welcome to my Advent of Code 2022 Day 16 cruise log.

I had a first look at it on December 16th, another day when I woke up way too late. Still, I managed to write the parsing code but left it at that before heading to the office. A work day, a Christmas party, a friend’s birthday and a World Cup final later, I found myself on Day 21 without having done any daily puzzle.

I figured I would catch up eventually after Day 21 to try and hit the 25th. Unfortunately, Christmas in Paris is not the best context to do any puzzle-solving. Indeed, some more family time with heavy celebrating led to absolutely zero line of code during that period.

Upon returning to London last Tuesday night, I decided to take a break from it all and just relax with my fiancee. She flew back from Italy the next day and I had no will to code at 10 pm after travelling. Finally, last night, I got back to it. I opened my laptop and reviewed the problem one more time while she walked the dog. I figured I could at least do the first part during that time.

Fortunately, I already wrote the parsing code so it was all about reasoning. Reading the problem statement a few times, I realised that I needed to go for a depth-first search algorithm using locations and points in time as my nodes. From there the coding was pretty straightforward and I clutched the first star for that Day 16.

Obviously, things got spicy when I read the second part. As my lady returned from walking the dog, I decided to leave it and pick it up in the morning so that we could enjoy the evening together. However, around 1 am, I had an inspiration and went back to the computer. From there I just coded away and within half an hour, my validation test for the second part passed. I could not believe that it would pass on the first attempt so I pinched myself. As it turns out I was definitely awake.

Surely, this was a fluke and I would end up having my input result denied but nope, I got the final Day 16 star. Still got to go and do days 17, 19, 20, 23, 24 and 25 plus the second half of days 18 and 22 but I’ll get there. I will definitely take the chill route of doing them whenever to keep enjoying life.

Thank you for reading my Advent of Code 2022 Day 16 log, I will see you when I see you. If you want to check out my previous entry, you can do so here. You can even read my entries from last year there. As usual, I will push the code to my repo for this year on Github. Also, if you want to test yourself against my AoC 2022 run, I’ve created a private leaderboard. The invite code is 382952-d065ee7a . Join, if you dare.

Photo by Pixabay

Be First to Comment

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    %d bloggers like this: