use aoc22::{day7, util}; const MAX_SIZE: usize = 100000; pub fn main() { let root = day7::parse_cmdline(&util::parse_input()); let mut total_size = 0; for child in root.borrow().all_children() { let c = &*child.borrow(); if let day7::Node::Dir { .. } = c { let size = c.size(); if size <= MAX_SIZE { total_size += size; } } } println!("Total size of small directories: {}", total_size); }