summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--2022/day01.awk10
1 files changed, 10 insertions, 0 deletions
diff --git a/2022/day01.awk b/2022/day01.awk
new file mode 100644
index 0000000..c81d624
--- /dev/null
+++ b/2022/day01.awk
@@ -0,0 +1,10 @@
+/[[:digit:]]+/ {
+	cals += $1;
+}
+/^$/ {
+	if (cals > max) max = cals;
+	cals = 0;
+}
+END {
+	print max;
+}