A few weeks back I saw a mention of Google Code Jam 2016. I'm relatively new to programming but I love a good challenge. So I registered, figuring it would be a good test of what I've learned so far. However, I pretty quickly forgot about it, and would've totally missed it if not for an email reminder yesterday. I felt totally unprepared but decided to give it a shot, and here's what happened...
First, a bit about CodeJam: This weekend was the Qualification Round, in which you're given 27 hours to answer up to four different problems. Each problem has "small" and "large" variants, which typically refer to the size and/or complexity of the inputs. You earn points for each correct solution you provide - the small variants are graded immediately upon submission, and you can try them again if your submission is incorrect. The large variants are only unlocked after you correctly answer the small version of the problem, and aren't graded until the end of the round. Each variant provides an opportunity to earn points, and if you accumulate more than 30 points by the end of the round you advance.
Now, 27 hours is plenty of time - the top performers appear to have answered all four variants within the first 45 minutes of the competition - but in my case I have two little kids and had committed to rearranging a bunch of furniture in the house today, so I was only able to work on them in short, sporadic bursts. In all I probably spent a total of 4-5 hours on the problems, most of which was spent scrambling in the final three hours, trying to work through the tougher problems after the epsilons had gone to bed.
With that disclaimer, I am pleased and proud to announce that I advanced past the Qualification Round:
The times in green represent how long past the start of the competition correct answers were submitted. Note that my answers for the large variant of each problem were submitted within 1-2 minutes of the small variant, and I assume this is generally the case for most participants. The procedure for solving them are basically the same, but it does take a bit of forethought to make sure your solution for the small variant will also work on the larger one.
All four problems now appear to be available for practice on the Code Jam website. In subsequent posts I'll discuss each of the first three problems and my solutions. I was frantically trying to get a solution in for the fourth problem near the end of the round, but as you can see I couldn't get it worked out in time. I am going to continue to work on it when I have a chance and will document that one as well.
And then it will be on to Round 1A next weekend!