Module day02

Source
Expand description

§Password Philosophy

Parsing the rules upfront allows both part 1 and part 2 to be solved in a straightforward manner.

There’s no need to first convert the input into lines since we know that each rule has 4 parts. Instead we use the split method with a slice of delimeters to break the input into an Iterator of tokens, then use our utility chunk method to group the tokens into an array of size 4.

Structs§

Rule

Functions§

parse
part1
part2