AdventOfCode2022/1/day1.awk
2022-12-03 01:08:01 +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}