aoc2022/d01/part1.awk

5 lines
142 B
Awk

# awk -f part1.awk < input | sort -n | tail -n 1
# awk -f part1.awk < input | sort -n | tail -n 3 | sum0
NF == 0 { print a; a = 0 }
{ a+=$1 }