Module aoc::year2017::day04

source ·
Expand description

§High-Entropy Passphrases

§Part One

We use a FastSet to detect duplicates. Sorting the words in each line then checking for duplicates in adjacent values also works but is slower.

§Part Two

To detect anagrams we first convert each word into a histogram of its letter frequency values. As the cardinality is at most 26 we can use a fixed size array to represent the set.

Then a FastSet is used to detect duplicates. Sorting the letters in each word so that anagrams become the same also works but is slower.

Functions§

Type Aliases§