TQ
dev.com

Blog about software development

Subscribe

Advent of Code programming puzzles

23 Dec 2019 - by 'Maurits van der Schee'

Every day in December I am doing a programming puzzle. The series is called Advent of Code and it follows the advent calendar approach. Every day from the 1st until the 25th of December one puzzle is unlocked. The puzzles get gradually harder and each puzzle has two parts, where the first part is easier than the second.

It is not about winning

Well, for some people it is. Only the first 100 answers are rewarded with points on the global leader board. I'm simply not fast enough to compete for a top 100 position. So for me it is not about winning. For most people it is not, as 95 thousand people have made the first puzzle and there is only place for 100 entries on the global leader board. The yearly unofficial survey asks people why they play and the reasons given are: for the fun (1st), the challenge (2nd) or to improve their skills (3rd).

Improving your skills

These puzzles are very well suited for learning a new programming language or refreshing your skills in a language you don't regularly use. In the past 5 years I have been competing in Go (2015), PHP (2016), Java (2017), Ruby (2018) and Python (2019). I have put all my answers on GitHub:

If I compete next year, then I think I will either pick C# or JavaScript.

Graphing the difficulty

I have put the time the first 100 contestants took to solve part 1 (purple) or part 2 (yellow) per day in a graph (below). As you can see some puzzles can be solved within a few minutes, while others take several hours. My estimation is that I'm about 3 to 5 times slower than the slowest player on the global leader board.


(image source)

The graph shows that day 22 (part 2) was the hardest puzzle this year. I've spent almost a full day and I was not able to solve it. Can you?

Enjoy programming!


PS: Liked this article? Please share it on Facebook, Twitter or LinkedIn.