added task 2

This commit is contained in:
matthias@arch 2022-12-03 01:33:29 +01:00
parent 4329ec863a
commit 17599f4fe7
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,8 @@
# Day 1 # Day 1
Get maximum number of calories an Elf carries
```shell ```shell
awk -f day1.awk input.txt # Find the Elf carrying the most Calories. How many total Calories is that Elf carrying?
awk -f day1-1.awk input.txt
# Find the top three Elves carrying the most Calories. How many Calories are those Elves carrying in total?
./day1.2.sh
``` ```

View File

@ -1 +0,0 @@
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}