AdventOfCode2022/01/day1-1.awk
2022-12-11 02:26:42 +01:00

2 lines
115 B
Awk
Executable File

BEGIN{sum=0; max_sum=0} {if (NF != 0) {sum+=$1} else {if (sum > max_sum) {max_sum=sum}; sum=0}} END{print max_sum}