diff --git a/rust/y2024/src/bin/solution_2024_02.rs b/rust/y2024/src/bin/solution_2024_02.rs index 9ee5d6ae..0fb017a9 100644 --- a/rust/y2024/src/bin/solution_2024_02.rs +++ b/rust/y2024/src/bin/solution_2024_02.rs @@ -24,9 +24,7 @@ fn valid_diffs_1(row: &[N], range: &RangeInclusive) -> bool { row.iter() .tuple_windows() .map(|(a, b)| b - a) - .filter(|diff| !range.contains(diff)) - .count() - == 0 + .all(|diff| range.contains(&diff)) } #[allow(dead_code)]