From 845138dd2d682a83d85f048f7461d8a03cd0ca87 Mon Sep 17 00:00:00 2001 From: Keenan Tims Date: Fri, 12 Dec 2025 03:42:42 -0800 Subject: [PATCH] day12: cache and bool --- src/day12.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/day12.rs b/src/day12.rs index f3fd20b..96d30e8 100644 --- a/src/day12.rs +++ b/src/day12.rs @@ -146,13 +146,12 @@ impl PresentsProblem { ) { if let Some(solution) = self.place_next(new_t, cur + 1, cache) { return Some(solution); - } else { - cache.insert((cur, t.area.clone())); } } } } } + cache.insert((cur, t.area.clone())); None } } @@ -237,7 +236,7 @@ mod tests { 12x5: 1 0 1 0 3 2"; #[rstest] - #[case(EXAMPLE, 0)] + #[case(EXAMPLE, 2)] fn part1_example(#[case] input: &str, #[case] expected: u64) { assert_eq!(part1(&parse(input)), expected); }