From c3d0397b05c5c33203cd875af508ae16050eef0b Mon Sep 17 00:00:00 2001 From: Viacheslav Slinko Date: Wed, 18 Dec 2024 13:25:14 +0300 Subject: [PATCH] day18 --- src/day18.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/day18.rs b/src/day18.rs index 0adbd3c..699d4db 100644 --- a/src/day18.rs +++ b/src/day18.rs @@ -103,7 +103,7 @@ unsafe fn find_fastest_path_score(grid: &[bool; GRID_SIZE]) -> usize { ($next_index:expr) => { let next_index = $next_index; - if *grid.get_unchecked(next_index) && *closed_set.get_unchecked(next_index) { + if *closed_set.get_unchecked(next_index) && *grid.get_unchecked(next_index) { let next_score = current.score + 1; if next_score < *best_scores.get_unchecked(next_index) {