From 394df58d6da6928a6a3ebae31362342deca74b48 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 1 Dec 2021 08:56:00 +0100 Subject: Add a shell script solution --- 2021/01/puzzles.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 2021/01/puzzles.sh (limited to '2021/01/puzzles.sh') diff --git a/2021/01/puzzles.sh b/2021/01/puzzles.sh new file mode 100644 index 0000000..9cf8043 --- /dev/null +++ b/2021/01/puzzles.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +paste -s input | awk '{ for (i = 1; i < NF; i++) c += $i < $(i + DELTA) } END { print c }' -- cgit v1.2.3