AdventOfCode2022/01/day1-1.awk

2 lines
115 B
Awk
Raw Normal View History

2022-12-03 01:33:53 +01:00
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}