summary refs log tree commit diff homepage
path: root/2018
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-12-01 00:52:20 -0500
committerJune McEnroe <june@causal.agency>2020-11-22 00:14:25 -0500
commit220dc71a6aafad18298b331f6b71393cc52f0344 (patch)
treeba69ad603e7bab04ea0a4f717e54c8f211bcbd88 /2018
parentSolve day 1 part 1 (diff)
downloadaoc-220dc71a6aafad18298b331f6b71393cc52f0344.tar.gz
aoc-220dc71a6aafad18298b331f6b71393cc52f0344.zip
Solve day 1 part 2
Diffstat (limited to '2018')
-rw-r--r--2018/day01-2.sh8
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
e='2019-05-27 22:07:50 -0400'>2019-05-27Add FrontierJune McEnroe 2019-05-27Break nicks with ZWNJJune McEnroe 2019-05-26Add DawnJune McEnroe 2019-05-20Declare vasprintf(3) for GNUJune McEnroe 2019-05-20Fix comparison warning in ttpreJune McEnroe 2019-05-20Add AuthorityJune McEnroe 2019-05-19Specify precedence of unary versions of operatorsJune McEnroe 2019-05-18Add compound assignment operators to orderJune McEnroe 2019-05-15Support simple assignment in orderJune McEnroe 2019-05-15Implement sizeof in orderJune McEnroe 2019-05-15Add orderJune McEnroe 2019-05-12Add T suffix in bitJune McEnroe 2019-05-10Highlight yacc and lex files as CJune McEnroe 2019-05-10Use val instead of suboptargJune McEnroe 2019-05-09Add Parable of the SowerJune McEnroe 2019-05-07Add bit without buildJune McEnroe 2019-05-04Fix MANDIR typoJune McEnroe 2019-05-04Move relay to binJune McEnroe