advent_of_code_2024

Module day_11

source
Expand description

This is my solution for Advent of Code - Day 11: Plutonian Pebbles

parse_input turns the text into numbers.

count_after_blinks solves both parts, calling count_for_stone recursively. This is cached as there are a lot of repeat small numbers at each depth. blink handles a single blink.

StaticsΒ§

FunctionsΒ§

  • blink πŸ”’
    This was originally written to work on the whole array of stones, but that wasn’t convenient for caching. It is left as is for convenience of using existing tests.
  • Solves both parts. Delegates to count_for_stone for each stone in the list.
  • count_for_stone πŸ”’
    Recursive function to calculate the expansion of a single stone. There are many repeats, especially for small numbers, so this is cached to allow the program to run quickly.
  • Origin of the cached function count_for_stone.
  • Primes the cached function count_for_stone. Recursive function to calculate the expansion of a single stone. There are many repeats, especially for small numbers, so this is cached to allow the program to run quickly.
  • parse_input πŸ”’
    Turn the space separated number strings into u64s
  • The entry point for running the solutions with the β€˜real’ puzzle input.