From 220dc71a6aafad18298b331f6b71393cc52f0344 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sat, 1 Dec 2018 00:52:20 -0500 Subject: Solve day 1 part 2 --- 2018/day01-2.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 2018/day01-2.sh (limited to '2018') diff --git a/2018/day01-2.sh b/2018/day01-2.sh new file mode 100644 index 0000000..66521fb --- /dev/null +++ b/2018/day01-2.sh @@ -0,0 +1,8 @@ +seq -f "$(cat)" ${1:-150} \ + | sed 's/^/last/' \ + | bc \ + | cat -n \ + | sort -s -n -k 2 \ + | uniq -d -f 1 \ + | sort -b -n \ + | head -n 1 -- cgit 1.4.1