projects
/
advent_of_code_2022.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e7a248
)
Simplification
author
Greg Burri
<greg.burri@gmail.com>
Sun, 11 Dec 2022 12:21:42 +0000
(13:21 +0100)
committer
Greg Burri
<greg.burri@gmail.com>
Sun, 11 Dec 2022 12:21:42 +0000
(13:21 +0100)
src/day11.rs
patch
|
blob
|
history
diff --git
a/src/day11.rs
b/src/day11.rs
index
9ad00bd
..
75a64af
100644
(file)
--- a/
src/day11.rs
+++ b/
src/day11.rs
@@
-85,8
+85,7
@@
pub fn run(monkeys: &mut [Monkey], nb_rounds: u64, worry_divided: u64) -> u64 {
}
}
- let most_inspected_items: Vec<&u64> = inspected.iter().sorted().rev().take(2).collect();
- most_inspected_items[0] * most_inspected_items[1]
+ inspected.iter().sorted().rev().take(2).product()
}
#[cfg(test)]