b.rs (222B)
1 mod common; 2 use common::*; 3 4 fn main() { 5 let e = get_elves_from_stdin(); 6 let mut w = e.iter().map(|a| a.iter().sum()).collect::<Vec<i64>>(); 7 w.sort_by(|a, b| b.cmp(a)); 8 println!("{}", w[0] + w[1] + w[2]); 9 }
![]() | aocMy solutions for the Advent of Code |
git clone https://git.tronto.net/aoc | |
Download | Log | Files | Refs | README |
b.rs (222B)
1 mod common; 2 use common::*; 3 4 fn main() { 5 let e = get_elves_from_stdin(); 6 let mut w = e.iter().map(|a| a.iter().sum()).collect::<Vec<i64>>(); 7 w.sort_by(|a, b| b.cmp(a)); 8 println!("{}", w[0] + w[1] + w[2]); 9 }