pub fn run(inp :Vec) { let mut curr_max = 0; let mut elves :Vec = vec![]; inp.iter().for_each(|elem| { let number = elem.parse::(); match number { Ok(n) => { curr_max += n; } Err(_) => { elves.push(curr_max); curr_max = 0; } } }); let mut sum = 0; for _ in 0..3 { let e = elves.iter_mut().max().unwrap(); sum += *e; *e = 0; } println!("a2: {}", sum); }