From 1fc8a7f4fe69bbf4eca6f2b1b308e2568966163e Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sun, 4 Dec 2022 01:44:27 -0600 Subject: [PATCH] Even parens --- 2022/rust/src/day4.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2022/rust/src/day4.rs b/2022/rust/src/day4.rs index abbba74..06a3e17 100644 --- a/2022/rust/src/day4.rs +++ b/2022/rust/src/day4.rs @@ -10,7 +10,7 @@ fn processed_input(input: &str) -> Vec> { fn both_parts(input: &Vec>) -> (usize, usize) { input.iter().fold((0, 0), |(a, b), n| { ( - (a + ((n[0] <= n[2] && n[1] >= n[3]) || (n[2] <= n[0] && n[3] >= n[1])) as usize), + a + (((n[0] <= n[2] && n[1] >= n[3]) || (n[2] <= n[0] && n[3] >= n[1])) as usize), b + ((n[0] <= n[3] && n[2] <= n[1]) as usize), ) })