View on GitHub

advent-of-code-2022

Readable Advent of Code 2022 algorithms and solutions in C language

Day 1: Calorie Counting

Let $L$ be a set where for all $\ell\in L$, $\ell$ is a list such that for all $e\in\ell$, we have $e\in\mathbb{N}$.

Part A

Return $\underset{\ell\in L}{\max}\left(\sum_{e\in\ell}e\right).$

Part B

Let $m_0\leftarrow 0$.

Let $m_1\leftarrow 0$.

Let $m_2\leftarrow 0$.

For $\ell\in L$:

Return $m_0+m_1+m_2$.