Improved finding min value
This commit is contained in:
parent
cb204b8d62
commit
7a1141f5ee
@ -1,5 +1,4 @@
|
|||||||
use crate::read;
|
use crate::read;
|
||||||
use itertools::Itertools;
|
|
||||||
use indextree::Arena;
|
use indextree::Arena;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -60,8 +59,7 @@ pub fn run() {
|
|||||||
|
|
||||||
println!("Day 7, Part 02: {}", total.iter()
|
println!("Day 7, Part 02: {}", total.iter()
|
||||||
.filter(|s|*s >= &free_needed)
|
.filter(|s|*s >= &free_needed)
|
||||||
.sorted()
|
.min()
|
||||||
.next()
|
|
||||||
.unwrap());
|
.unwrap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user