summary refs log tree commit diff stats
path: root/2022/day-01/day-01.raku
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2022-12-01 13:53:24 +0530
committerAndinus <andinus@nand.sh>2022-12-01 13:53:24 +0530
commit2cb4ddc5393f67ff53d991c76f938dd06fc7bf93 (patch)
tree87a75c69f4bdfb47e6ffd5cffeba0f396a0a9e1c /2022/day-01/day-01.raku
parent72984202e1da518ee4b3201369ed50699bb840b0 (diff)
downloadaoc-2cb4ddc5393f67ff53d991c76f938dd06fc7bf93.tar.gz
Add 2022/day-01 solution HEAD master
I'll add readme later.
Diffstat (limited to '2022/day-01/day-01.raku')
-rw-r--r--2022/day-01/day-01.raku7
1 files changed, 7 insertions, 0 deletions
diff --git a/2022/day-01/day-01.raku b/2022/day-01/day-01.raku
new file mode 100644
index 0000000..cbe8b92
--- /dev/null
+++ b/2022/day-01/day-01.raku
@@ -0,0 +1,7 @@
+#!/usr/bin/env raku
+
+# @calories records calories carried by each Elf, sorted.
+my Int @calories = "input".IO.split("\n\n").map(*.lines.sum).sort;
+
+put "Part 1: " ~ @calories.tail;
+put "Part 2: " ~ @calories.tail(3).sum;