Advent of Code - Day 14

Here is my solution.

It takes less than 3 seconds on my computer.

I store the recipes in a binary, appending to it using the binary syntax. An append operation to a binary is specially optimized by Erlang’s runtime system, in that it will allocate extra storage when appending so that the next append operation will be cheaper. See the section about constructing binaries in the Efficiency Guide.

6 Likes