corrected day 21

This commit is contained in:
Ishan Jain 2024-12-22 14:06:10 +05:30
parent a987bcae29
commit cfd1c55632
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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;
}