Advent of Code 2024 - Day 11Plutonian Pebbles
| Problem statement | Source code | Tags: Dynamic programming
This problem pays tribute to 2019 day 20.
This is yet another lanternfish problem. Each time, the objects can morph into other objects, but objects in the same state are indistinguishable. Therefore we can keep track of how many objects are in each state.
First we can count the existing states.
Each time, we evolve the counts by applying the rules. All 0's become 1's; numbers with even digits are split; the rest are * 2024.
Parts 1 and 2 just apply evolve 25 and 75 times, respectively.