From 4acdecdeef896395ddd4ece8ccb419054797efa3 Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Thu, 1 Dec 2022 16:12:18 -0800 Subject: [PATCH] day 1 awk solution --- day01/sol.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 day01/sol.sh diff --git a/day01/sol.sh b/day01/sol.sh new file mode 100644 index 0000000..6b09140 --- /dev/null +++ b/day01/sol.sh @@ -0,0 +1,8 @@ +# solve day 1 with awk and sort + +# part 1 +awk 'BEGIN{RS="\n\n";m=0} {t=0; for(i=1;i<=NF;i++)t+=$i; if(m