diff --git a/src/day21/1.rs b/src/day21/1.rs index 660adc7..914865b 100644 --- a/src/day21/1.rs +++ b/src/day21/1.rs @@ -168,7 +168,7 @@ pub fn run(input: &str) -> i64 { for seq in seq { let seq_num = seq.read_num(); - let shortest = compute(NAV_KEYPAD, seq, 1 + 25, &mut cache); + let shortest = compute(NAV_KEYPAD, seq, 1 + 2, &mut cache); answer += seq_num as i64 * shortest; } @@ -341,7 +341,7 @@ fn main() { } #[bench] -fn part2(b: &mut test::Bencher) { +fn part1(b: &mut test::Bencher) { b.iter(|| { let v = run(INPUTS[1]); test::black_box(v); diff --git a/src/day21/2.rs b/src/day21/2.rs index d6b2f20..660adc7 100644 --- a/src/day21/2.rs +++ b/src/day21/2.rs @@ -168,7 +168,7 @@ pub fn run(input: &str) -> i64 { for seq in seq { let seq_num = seq.read_num(); - let shortest = compute(NAV_KEYPAD, seq, 1 + 2, &mut cache); + let shortest = compute(NAV_KEYPAD, seq, 1 + 25, &mut cache); answer += seq_num as i64 * shortest; }