summary refs log tree commit diff homepage
path: root/2018
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
commite69c0f08d018c5f2144c9a55d63173d6973d1535 (patch)
treebb0c82247a12d5dd0adbd7385f34c3788a031981 /2018
parentSolve day 2 part 2 (diff)
downloadaoc-e69c0f08d018c5f2144c9a55d63173d6973d1535.tar.gz
aoc-e69c0f08d018c5f2144c9a55d63173d6973d1535.zip
Un-hardcode width of input in day 2
Diffstat (limited to '')
-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