aboutsummaryrefslogtreecommitdiff
path: root/2022/01/b.rs
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-06-26 09:47:23 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-06-26 23:37:23 +0200
commitfa26f694d8cf98272763952a698301ee9935c19e (patch)
tree5af7a788fb8e9fa12b2b2fbea64250ed496a23c0 /2022/01/b.rs
parentf0159b7d36e2c81182f2d047a34bf883394894db (diff)
downloadaoc-fa26f694d8cf98272763952a698301ee9935c19e.tar.gz
aoc-fa26f694d8cf98272763952a698301ee9935c19e.zip
Added 2022, first few problems
Diffstat (limited to '2022/01/b.rs')
-rw-r--r--2022/01/b.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/2022/01/b.rs b/2022/01/b.rs
new file mode 100644
index 0000000..ca0b324
--- /dev/null
+++ b/2022/01/b.rs
@@ -0,0 +1,9 @@
1mod common;
2use common::*;
3
4fn 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}

Generated with cgit - Back to sebastiano.tronto.net