added task 2
This commit is contained in:
parent
4329ec863a
commit
17599f4fe7
@ -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
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -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}
|
|
Loading…
Reference in New Issue
Block a user