Module aoc::year2020::day10

source ·
Expand description

§Adapter Array

Part one uses the windows function to iterate over all pairs counting the differences.

Part two is a classic dynamic programming problem. The charging outlet can be arranged in exactly one way. Each subsequent adapter can be arranged in the sum of the number of ways that the adapters at -1, -2 and -3 jolts can be arranged.

Functions§