pub fn main() { let txt = std::fs::read_to_string("./input/day14.txt").unwrap(); let input = txt .lines() .map(|s| s.chars().collect::>()) .collect::>>(); let mut sum: u64 = 0; for j in 0..input[0].len() { let mut off: u64 = 0; for i in 0..input.len() { if input[i][j] == 'O' { sum += input.len() as u64 - off; off += 1; } else if input[i][j] == '#' { off = (i + 1) as u64; } } } println!("{}", sum); }