Skip to content

The Advent of Code 2020 Day 9 log, Weakness exploit

Posted in Advent of Code

Hello, there and welcome to my Advent of Code 2020 Day 9 cruise log. Today was fun, kinda reminds of some whiteboard interview questions. Find the number that matches this or that property based on other numbers in a suite. Nothing insane if you’ve seen that shape of problem before. If not then it can be tricky to solve but otherwise easy stuff.

As you may notice, there is no such thing as easy when you wake up at 4.20 am for AoC. Or for anything else, really. Heck, I tried to take a sip of water before starting and I spilt it on my tank top. Even though I fought my foggy brain with the power of the loudest Spotify songs I could find.

Similarly to this missed sip of water exploiting the weakness of my awakening, today we had to exploit a weakness in the XMAS cypher. Here, XMAS stands for eXchange-Masking Addition System. Finding names to match intersting accronyms is hard, ask the APOIL people.

Back to the problem, really nothing noteworthy happened there. I wrote an empty implementation, then tests, tests failed. Then I actually implemented my part one and the tests passed. After that I did the same for part two, tests kept failing. This marked the return of the foggy brain as I was testing the method from part one expecting the result for the final part. After a few minutes wondering what was wrong with my code, I figured the test was erroneous. As soon as I used the right method, the tests passed. I run my input, it goes through instantly despite the suspiciously high number and I drop my usual victory tweet.

Thank you for reading my Advent of Code 2020 Day 9 cruise log, I will see you tomorrow, maybe. In the meantime, you can check out my Go Cloud series about building and deploying a Golang app to AWS. Also, I will push my code on Github at CodingNagger/advent-of-code-2020 so feel free to check it out but not before you’ve done the challenge yourself. Bye!

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: