From 74439923dd58ace9762a29e97bad6ba90f299505 Mon Sep 17 00:00:00 2001 From: setop Date: Thu, 1 Dec 2022 22:56:49 +0100 Subject: [PATCH] day 1, add edge case for last block --- d01/part1.awk | 1 + 1 file changed, 1 insertion(+) diff --git a/d01/part1.awk b/d01/part1.awk index f838e55..aa679e1 100644 --- a/d01/part1.awk +++ b/d01/part1.awk @@ -2,3 +2,4 @@ # awk -f part1.awk < input | sort -n | tail -n 3 | sum0 NF == 0 { print a; a = 0 } { a+=$1 } +END { print a; }