What is this?
Advent of Code is an annual programming contest that runs during the first 25 days of December. The 10th annual one was just completed, and it was great fun - another successful contest by its creator.
However, there was one day where the color text didn't 100% sit right with me—the color text seemed to be setting us up for a problem that then wasn't presented. I happen to think that problem is interesting, so this is my own attempt at extending that text to ask that problem.
Setup/background
The day in question is 2024 day 11. Complete parts 1 and 2 of the problem as given there before reading on.
Unlike the original Advent of Code problems, this problem will explicitly require an
arbitrary precision integer
library, such as using math/big
in golang, java.math.BigInteger
in
java, Integer
(not Int
) types in haskell, bigint
in perl
or BigInt
in javascript.
Extension
The historians return and notice the huge collection of stones.
“Oh no!” one shouts. “Has someone been blinking?”
You admit that you have been, and the historians explain that for reasons of
accurate record keeping it is vital that they maintain carefully a checksum
of all the stones, and update it with every blink. The checksum is computed by
multiplying each stone's value by its position in line (beginning with 0
,
so the first stone in line doesn't count).
For example, taking the sample input from before of 125 17
, after
four blinks the checksum would be 0*512 + 1*72 + 2*2024 + 3*2 + 4*0 + 5*2 + 6*4 + 7*2867 + 8*6032 = 72485
and after 6 blinks the checksum is 44893
The historians say that they had planned for some blinking to happen so they already know that
after 25 blinks, when starting with 125 17
, the checksum would be
2507617947379703
.
However, they're now in the situation of 75 blinks after the initial 125 17
.
What's the checksum now?
How to check your answer
To check your answer, go to https://breakmessage.com/aocextension/2024day11/NNNNNN/
where NNNNNN
is your answer. (so, e.g., you'd go to https://breakmessage.com/aocextension/2024day11/12345/
if your answer
was 12345
).
Remember to use the initial input 125 17
. Do not use the input data given to you from the
official Advent of Code site. I don't have the kind of infrastructure to host that individualized puzzle
experience.