AdventOfCode2022/01
2022-12-11 02:26:42 +01:00
..
day1-1.awk renamed because github is stupid 2022-12-11 02:26:42 +01:00
day1-2.sh renamed because github is stupid 2022-12-11 02:26:42 +01:00
input.txt renamed because github is stupid 2022-12-11 02:26:42 +01:00
README.md renamed because github is stupid 2022-12-11 02:26:42 +01:00

Day 1

🎁

Today's language: awk + GNU-coretils

  • Task 1: We use awk to find the maximum while we iterate through the file
  • Task 2: We use awk again for summing the calories, then sort them and take the top 3 which we again sum up with awk
# 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