I took part in Advent of Code 2023 and I wanted to document my experience before I forget too many details.

I had heard of the event, but had never participated in previous Advents of Code. I started on Day 4 and played catch-up.

Overall, I am glad that I tried and I learned a lot from the experience.

stats

I am sure that I would not impress anybody with my stats, but there they are.

Building a toolbox

Some problems rely on previous problems, so in that sense, it is good to keep old code handy. But more generally, keeping several common algorithms and data structures readily available makes everything faster and easier.

Balancing between not solving by brute force vs. not solving the general problem

The actual input of a problem may have a specific structure that does not require the general solution of the problem. There may be shortcuts. Look at the input! The question being asked is only about the specific input, not the general problem. Any hacks that apply to the specific input are completely acceptable.

Solutions required larger and larger numbers

Some solutions extended beyond 64 bits, and so Mathematica was used for arbitrary precision.

Not fully specified

This is the normal evolution of Advent of Code as the month progresses. In the beginning the descriptions tend to spell out everything. Further along there’ll be edge cases in your input that aren’t shown in the examples in the description. Towards the end, you get some puzzles that then flip the script and are only tractable because of certain special properties in the input (and it’s up to you to spot them).

Day 20 seemed not fully specified.

The feeling about starting each day

It is a good feeling solving problems, if only for elves.

Time management

I just could not solve some in a single day. So I needed to time box the work.

Asked for help on reddit

There is a great community at the Advent subreddit.

Visualize!

Many of the problems have specific inputs that have hidden structure, and that hidden structure makes it easier to solve than the fully general problem ostensibly being asked.

Messy code

No memory safety!

Leaks everywhere!

Error handling is at a minimum.

Just assert or panic and move on.

Who cares!

Some solutions are slow and inefficient

and that’s ok.

Next year

I will be ready next year!

See my Mathematica notebook collecting all of the problems.

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

stats

Updated: