Function aoc::y23d12::y23d12

source ·
pub fn y23d12(input: &str, times: u32) -> usize
Expand description

The solution for the day twelve challenge.

We take the input as a string as usual and then the second parameter specifies how many times we’re supposed to expand the record: just once in part one (i.e., the original input as-is) and five times in part two. We then call our recursive counter for each of the records adding them to the final sum and then we’re done.

§Example

// probably read this from the input file...
let input = ".????..??#?. 3,2";
assert_eq!(y23d12(input, 1), 4);
assert_eq!(y23d12(input, 5), 1024);