From 329fdc7399c7d742838a4882edd69794e554f325 Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Sun, 11 Dec 2022 13:54:20 +0100 Subject: [PATCH] 2022 rust day 11 --- 2022/rust/src/solutions/day11.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/2022/rust/src/solutions/day11.rs b/2022/rust/src/solutions/day11.rs index 4e416c0..af1ff76 100644 --- a/2022/rust/src/solutions/day11.rs +++ b/2022/rust/src/solutions/day11.rs @@ -67,12 +67,14 @@ fn find_inspects(data: &Vec, rounds: i32, divide: bool) -> BinaryHeap) -> i64 { - find_inspects(&data, 20, true).iter().take(2).product() + find_inspects(&data, 20, true) + .into_sorted_vec().iter().rev().take(2).product() } // brb, speedrunning modular arithmetic course to solve this puzzle fn solve2(data: &Vec) -> i64 { - find_inspects(&data, 10000, false).iter().take(2).product() + find_inspects(&data, 10000, false) + .into_sorted_vec().iter().rev().take(2).product() }