diff options
Diffstat (limited to '2022/01/puzzle-1.awk')
-rwxr-xr-x | 2022/01/puzzle-1.awk | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/2022/01/puzzle-1.awk b/2022/01/puzzle-1.awk index 406a663..564bb46 100755 --- a/2022/01/puzzle-1.awk +++ b/2022/01/puzzle-1.awk @@ -1,5 +1,5 @@ #!/usr/bin/awk -f -/[0-9]+/ { acc += $1; next } - { if (acc > max) max = acc; acc = 0 } +/[0-9]+/ { acc += $1 } +!/./ { if (acc > max) max = acc; acc = 0 } END { print max } |