summary refs log tree commit diff homepage
path: root/2018/day01-2.sh
blob: 66521fb6d51f5731b0de5d95dc4ce250e239c3ab (plain) (blame)
1
2
3
4
5
6
7
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