aoc::year2024::day19

Function perfect_hash

Source
fn perfect_hash(b: u8) -> usize
Expand description

Hashes the five possible color values white (w), blue (u), black (b), red (r), or green (g) to 0, 2, 4, 5 and 1 respectively. This compresses the range to fit into an array of 6 elements.