Module aoc::y23d12

source ·
Expand description

Advent of Code 2023 Day 12: https://adventofcode.com/2023/day/12

Today’s problem was very challenging. The solution ends up using recursion to try all of the possibilities, and then in part two to avoid the runtime exploding maintains a cache of seen values to check against instead of recomputing each time (we actually then use this in part one too, but it’s not necessary). The key hint for me comes from a comment on the subreddit which says to add a final, trailing ‘.’ to each input string to help find the end of each line of input.

Functions§

  • The solution for the day twelve challenge.