small tweak in day11
This commit is contained in:
@@ -39,7 +39,7 @@ fn sum_paths_mat(start_idx: usize, end_idx: usize, adj_matrix: &Vec<Vec<usize>>)
|
|||||||
loop {
|
loop {
|
||||||
paths = paths + step[(start_idx, end_idx)] as u64;
|
paths = paths + step[(start_idx, end_idx)] as u64;
|
||||||
step = &adj_mat * step;
|
step = &adj_mat * step;
|
||||||
if step.sum() < 0.1 {
|
if step.row(start_idx).sum() < 0.1 {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user