Clean up part 2
This commit is contained in:
parent
0b9a1061a0
commit
42c911c9a2
@ -135,8 +135,8 @@ fn solve_part2(input: &[CliOperation]) -> usize {
|
||||
let necessary_to_free = 30_000_000 - free_space;
|
||||
tree.traverse_post_order(tree.root_node_id().unwrap())
|
||||
.unwrap()
|
||||
.filter(|node| node.data().1 >= necessary_to_free)
|
||||
.map(|node| node.data().1)
|
||||
.filter(|&size| size >= necessary_to_free)
|
||||
.min()
|
||||
.unwrap()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user