summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-12-02 00:49:25 -0500
committerJune McEnroe <june@causal.agency>2020-11-22 00:14:25 -0500
commit5440efe45bce5b4663ffc44d5033781f3f6c39e9 (patch)
tree669cee9551e6524e6a66462954b4287f3a214e80
parentSolve day 2 part 2 (diff)
downloadaoc-5440efe45bce5b4663ffc44d5033781f3f6c39e9.tar.gz
aoc-5440efe45bce5b4663ffc44d5033781f3f6c39e9.zip
Un-hardcode width of input in day 2
-rw-r--r--2018/day02-2.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/2018/day02-2.sh b/2018/day02-2.sh
index c7876cb..ef8bcc2 100644
--- a/2018/day02-2.sh
+++ b/2018/day02-2.sh
@@ -1,6 +1,6 @@
 input=$(mktemp)
 cat > $input
-for i in $(seq 26); do
+for i in $(seq $(head -n 1 $input | wc -c)); do
 	colrm $i $i < $input | sort | uniq -d
 done
 rm $input