Function advent_of_code_2021::day_14::into_pair_counts[−][src]

fn into_pair_counts(polymer_chars: &Vec<char>) -> HashMap<(char, char), usize>
Expand description

Split a list of characters into the counts of all the consecutive pairs that exist. The hard work is delegated to library functions slice::windows to give an iterator of the pairs and Itertools::counts to reduce that to the required map.