Function aoc::year2023::day25::parse

source ยท
pub fn parse(input: &str) -> Input
Expand description

Convert the input to use numeric indices instead of string keys for speed. Each node is assigned a unique index on a first come first served basis. Then the edges are gathered into a single vec so that each edge also has a unique index.

As both node and edge indices are contigous this allows us to use a vec to store previously seen values which is must faster than using a HashMap.