diff --git a/day3/src/main.rs b/day3/src/main.rs index 4904ad5..299e2c4 100644 --- a/day3/src/main.rs +++ b/day3/src/main.rs @@ -38,7 +38,7 @@ fn get_most_in_col(v: &Vec>, c: usize) -> u32 { fn get_o2(v: &Vec>, c: usize) -> u32 { if v.len() == 1 { return bit_vec_to_u32(&v[0], false); } - + let a = get_most_in_col(&v, c); let f = v.into_iter().filter(|e| e[c] == (a + 1) % 2) .fold(vec![], |mut acc, e| { acc.push(e.to_owned()); return acc;}); @@ -47,7 +47,7 @@ fn get_o2(v: &Vec>, c: usize) -> u32 { fn get_co2(v: &Vec>, c: usize) -> u32 { if v.len() == 1 { return bit_vec_to_u32(&v[0], false); } - + let a = get_most_in_col(&v, c); let f = v.into_iter().filter(|e| e[c] == a) .fold(vec![], |mut acc, e| { acc.push(e.to_owned()); return acc;});