use itertools::Itertools; fn main() { let input: String = include_str!("../../input").to_string(); let mut calories: Vec = Vec::new(); for (key, group) in &input.lines().group_by(|line| line.is_empty()) { if key { calories.push(group.into_iter().map(|i| i.parse::().unwrap()).sum()); } } println!("{}", calories.iter().max().unwrap()); }