Advent of Code 2022 Day 1 Solution: Calorie Counting

A fun coding advent calendar for anyone to try, including my solutions for the day

Ashley Peacock

--

Photo by Elena Mozhvilo on Unsplash

Spoilers ahead for day 1 of Advent of Code! If you don’t want to be given the answers, look away now!

Since 2015, there has been an annual coding advent calendar run by Eric Wastl. It’s called the Advent of Code, and it’s exactly as it sounds: each day, you get a new challenge consisting of two problems. The second problem builds upon the first.

You don’t need to know any specific languages to take part, in fact, you can complete it in any language you like. The problems each come with a large dataset (to prevent people manually working it out!) that you can use with any language, and you must work out an answer for each problem. Completing the first problem unlocks the second for that day.

All you have to do is go to https://adventofcode.com/ to get started, so if you want to give today’s challenge a go before seeing the answers, now is a good time! If you’re curious to see how I worked it out, read on…

The Problem: Elven Calorie Counting

I’m not going to share the whole problem, such as the story, as I don’t want to take that away from the website. However, I will…

--

--