Day 4, puzzle 2
This commit is contained in:
9
src/bin/d4p2.rs
Normal file
9
src/bin/d4p2.rs
Normal file
@ -0,0 +1,9 @@
|
||||
use aoc22::{day4, util};
|
||||
|
||||
pub fn main() {
|
||||
let assignments = day4::parse_assignments(&util::parse_input());
|
||||
|
||||
let overlapping = assignments.iter().filter(|a| a.0.overlaps(&a.1)).count();
|
||||
|
||||
println!("{} assignments overlap", overlapping);
|
||||
}
|
||||
Reference in New Issue
Block a user