Function aoc::year2023::day25::perfect_minimal_hash

source ·
fn perfect_minimal_hash(
    lookup: &mut [usize],
    nodes: &mut Vec<Vec<usize>>,
    slice: &[u8],
) -> usize
Expand description

Each node’s name is exactly 3 lowercase ASCII letters. First we calculate a perfect hash by converting to a base 26 number. Then we construct a perfect minimal hash by using the first index to lookup a contigous index into the nodes vec.