aboutsummaryrefslogtreecommitdiff
path: root/2015/12/puzzle-2.sh
blob: e97fc8a84e033ab4de41571d2f654bbedbe8e312 (plain) (blame)
1
2
3
4
5
6
7
#!/usr/bin/env sh

jq 'walk(if type == "object" then del(select(.[] == "red")) end)' input \
	| tr -c '\-0-9' '\n' \
	| squash \
	| paste -sd+ \
	| bc