Module aoc::y22d01

source ·
Expand description

Advent of Code 2022 Day 1: https://adventofcode.com/2022/day/1

This challenge essentially boils down to getting the n largest items, where in part one n is one.

As described on the challenge page each elf is carrying one or more (food) items with a (calorie) value. Each item is on one line and each elf is separated by a (single) empty line.

The solution as I have envisioned it is to use a max heap to keep track of the items and then return the requested number of items in largest-first order.

Functions§

  • The solution for the day one challenge.