2022 day 1: prepare bash common code + bash solutions

This commit is contained in:
2022-12-01 10:28:40 +01:00
parent 0fb4219c92
commit dbff06e5da
6 changed files with 2421 additions and 12 deletions

View File

@@ -64,10 +64,26 @@ this is /=24000=/ (carried by the fourth Elf).
Find the Elf carrying the most Calories. /How many total Calories is
that Elf carrying?/
To begin, [[file:1/input][get your puzzle input]].
Your puzzle answer was =66719=.
Answer:
** --- Part Two ---
By the time you calculate the answer to the Elves' question, they've
already realized that the Elf carrying the most Calories of food might
eventually /run out of snacks/.
You can also [Shareon
[[https://twitter.com/intent/tweet?text=%22Calorie+Counting%22+%2D+Day+1+%2D+Advent+of+Code+2022&url=https%3A%2F%2Fadventofcode%2Ecom%2F2022%2Fday%2F1&related=ericwastl&hashtags=AdventOfCode][Twitter]]
[[javascript:void(0);][Mastodon]]] this puzzle.
To avoid this unacceptable situation, the Elves would instead like to
know the total Calories carried by the /top three/ Elves carrying the
most Calories. That way, even if one of those Elves runs out of snacks,
they still have two backups.
In the example above, the top three Elves are the fourth Elf (with
=24000= Calories), then the third Elf (with =11000= Calories), then the
fifth Elf (with =10000= Calories). The sum of the Calories carried by
these three elves is =45000=.
Find the top three Elves carrying the most Calories. /How many Calories
are those Elves carrying in total?/
Your puzzle answer was =198551=.
Both parts of this puzzle are complete! They provide two gold stars: **