Skip to content

Commit

Permalink
fix(2023): actually need all instead of sum, doc tests failed
Browse files Browse the repository at this point in the history
  • Loading branch information
believer committed Dec 9, 2023
1 parent f513007 commit 7475ffc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/2023/src/day_09.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn input_generator(input: &str) -> Input {
series.append(&mut vec![differences.clone()]);

// When all the differences are 0, we have found the last row
if differences.iter().sum::<i64>() == 0 {
if differences.iter().all(|&x| x == 0) {
break;
}

Expand Down

0 comments on commit 7475ffc

Please sign in to comment.