aboutsummaryrefslogtreecommitdiff
path: root/2015/10/puzzles.sh
blob: 291ac966b08a82829135b016dcddc702a634ace2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env sh

output()
{
	echo $in | tr -d '\n' | wc -c
}

in=$(cat input)
for i in $(seq 1 50); do
	in=$(echo "$in" | fold -w1 | uniq -c | tr -d '\n ')
	[ $i -eq 40 ] && output
done
output