Module mbryant_aoc2021::day9
source · [−]Expand description
An obvious BFS day that is more efficiently solved with a linear pass and a modified union-find.
Constants
Functions
Naive parsing
Naive solution of finding all points with strictly higher neighbors.
Generate a grid containing an initial basin for each point, then do an efficient union-find to merge the initial basins and yield the actual set of basins in O(grid size) time.