AoC '21, Day 12


The nodes of an undirected graph are partitioned into two subsets. One subset contains visit-1 nodes, which can appear on a path at most once, and the other subset contains visit-n nodes, which can appear on a path n times. Two nodes in the visit-1 subset are designated start and end nodes. The first problem counts all paths between the start and end nodes assuming the node-path rules are followed; the second problem also counts all paths between start and end, but a path may contain two appearances of a single visit-1 node.