20 lines
376 B
Rust
20 lines
376 B
Rust
|
|
||
|
|
||
|
pub fn run(inp :Vec<String>) {
|
||
|
|
||
|
let mut v :Vec<i32> = vec![];
|
||
|
inp.split(|line| line.is_empty()).for_each(|vector|{
|
||
|
v.push(vector.iter().map(|s| s.parse::<i32>().unwrap()).sum());
|
||
|
});
|
||
|
|
||
|
let mut sum = 0;
|
||
|
|
||
|
for _ in 0..3 {
|
||
|
let e = v.iter_mut().max().unwrap();
|
||
|
sum += *e;
|
||
|
*e = 0;
|
||
|
}
|
||
|
|
||
|
println!("a2v2: {}", sum);
|
||
|
|
||
|
}
|