Module aoc::y15d01

source ·
Expand description

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

These challenges are extremely simple and basically amount to incrementing or decrementing a counter based on observed characters in a string.

We implement this as two distinct functions as the return type is different because depending on the input it would technically be possible in the second part to never reach the basement (negative counter). The second part also returns a strictly positive number whereas in part one it could be possible to return a negative number.

Functions§

  • The solution for part one of the day one challenge.
  • The solution for part two of the day one challenge.