day 10: Use lookup table
day 10: Use lookup table

There are some repeated calculations going on here (many elements might
ask how long element E is after N rounds), and they can all be cached.

Before this improvement, this code would only be able to run ~68
iterations in one minute.
After this improvement, it is capable of 250,000 iterations in one
minute. Amazing that a small change like this gets this much speedup.

The disadvantage is that I am no longer able to print out the digits of
the sequence - I'd only be able to print out the lengths. Since I'm not
being asked for the digits anyway, I consider this acceptable.

petertseng/adventofcode