Skip to content

The Advent of Code 2020 Day 4 log, passport bamboozling

Posted in Advent of Code

Hello, there and welcome to my Advent of Code 2020 Day 4 cruise log. Yesterday, I was out here telling you all about how I shouldn’t start AoC challenges before 7am. Looks like that was bullshit. Today went swimmingly but there was one key difference. I was much more careful with the tests I wrote.

Indeed, during Days 2 & 3, I wasted a lot of time debugging issues I should have spotted up-front. My tests weren’t good enough to begin with. With that lesson in mind, I decided to sacrifice speed for slow but deadly precision when it came to my tests. I even went red-green on this sucker which probably burnt some more time. In such early days that definitely costs a few hundred spots in the global rankings. Plus it’s not like anything below the top 100 really counts anyways.

So on the problem itself, it was input validation just as yesterday. It could be the thread for this year as IntCode was last year but I doubt it. Basically you parse passwords and validate the contents. Pretty fun stuff to do and even though TDD might have been overkill here I played it safe. Got burned twice, if that happened a third time I would have legit retired. Fool me once, maybe twice but the third is the one where you put the controller down and walk away, just like FIFA.

There isn’t much to say here as I ran into no issue. I’m guessing that I could have used regular expressions all the way through at that time of the day it’s playing with fire. I had a mix of parsing inputs for the trickiest fields to validate then regexp for the rest. I’m definitely looking forward to seeing what people came up with to solve this one. Especially those that might have gone full regexp. I have a vague idea on how but vague doesn’t cut it for pre-8 am JD.

Simplicity was rewarded as not I got back in the global top 6k for part 2.

On top of that, it keeps me in the race to threaten my company top spot and temporarily capture the London office one. So, looks like I dropped back to second so nevermind that screengrab. Still grabbed some points. Finishing first enough times will grant this to me. By the end of the first week, we will definitely get into the danger zone. Right now we’re # where we start losing people. At that time last year, we lost half the participants.

Advent of Code 2019 worldwide completion stats

It’s almost 7 am, I need to stretch and go workout. Today’s rest day and that cardio won’t do itself. Heck, I’m even going to watch Kevin Hart’s latest special while I’m at it.

Thank you for reading my Advent of Code 2020 Day 4 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!

Photo by Natasha Chebanoo from Pexels

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: