day 25 optimize and improve heuristics
[aoc_eblake.git] / 2015 / advent12.sh
blob66d7432a0e8b9ddcf7b711d714c252fa574102b0
1 if [[ ! $part1 ]]; then
2 exec < <(jq 'delpaths([path(..|select(type=="object" and .[] == "red"))])')
3 fi
5 sum=0
6 for val in $(tr -c '0-9-' ' '); do
7 sum=$((sum+val))
8 done
9 echo $sum