Skip to content

Commit

Permalink
2024-02 Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
jurisk committed Dec 2, 2024
1 parent 04e4284 commit fcca447
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions rust/y2024/src/bin/solution_2024_02.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ fn valid_diffs_1(row: &[N], range: &RangeInclusive<N>) -> 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)]
Expand Down

0 comments on commit fcca447

Please sign in to comment.