Improved finding min value

This commit is contained in:
max.nuding 2022-12-07 09:20:59 +01:00
parent cb204b8d62
commit 7a1141f5ee
Failed to extract signature

View File

@ -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());
} }
} }