From 13f17fb1180375e64e02d1a3b9bc5faacc14c588 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 3 Dec 2021 14:14:40 +0100 Subject: Add 2017 Day 1 solutions --- 2017/01/puzzle-1.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 2017/01/puzzle-1.sh (limited to '2017/01/puzzle-1.sh') diff --git a/2017/01/puzzle-1.sh b/2017/01/puzzle-1.sh new file mode 100755 index 0000000..2659fae --- /dev/null +++ b/2017/01/puzzle-1.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +sed ' +:l +s/\(.\)\1/<\1>\1/g +tl +s/^\(.\)\(.*\)\1$/<\1>\2/ +s/>[0-9]*[0-9]*$// +' input | bc -- cgit v1.2.3