#[path = "../lib.rs"] mod lib; fn main() { let mut width = 0; let mut height = 0; let mut cols = vec![]; let mut sum = 0; let mut count = 0; for (y, line) in lib::iter_input().enumerate() { height = y; if width == 0 { width = line.len(); cols = vec![0; width]; } for (x, b) in line.bytes().enumerate() { match b { b'#' => { cols[x] = y + 1 }, b'O' => { sum += cols[x]; cols[x] += 1; count += 1; }, b'.' => {}, _ => unreachable!(), } } } println!("part1: {}", count * (height + 1) - sum); }