diff options
author | June McEnroe <june@causal.agency> | 2018-12-01 00:52:20 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2018-12-01 00:52:20 -0500 |
commit | 99a38c99e7743eec8a79fd5df39d79eadf1d7128 (patch) | |
tree | e3bc68c24da8e31f47709c1aa757821595259059 /2018/day01-2.sh | |
parent | Solve day 1 part 1 (diff) | |
download | aoc-99a38c99e7743eec8a79fd5df39d79eadf1d7128.tar.gz aoc-99a38c99e7743eec8a79fd5df39d79eadf1d7128.zip |
Solve day 1 part 2
Diffstat (limited to '')
-rw-r--r-- | 2018/day01-2.sh | 8 |
1 files changed, 8 insertions, 0 deletions
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 |