Even parens

This commit is contained in:
Daniel Flanagan 2022-12-04 01:44:27 -06:00
parent 8dbd0cf9af
commit 1fc8a7f4fe
Signed by: lytedev
GPG Key ID: 5B2020A0F9921EF4
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ fn processed_input(input: &str) -> Vec<Vec<i32>> {
fn both_parts(input: &Vec<Vec<i32>>) -> (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),
)
})