Module aoc::year2017::day05

source ·
Expand description

§A Maze of Twisty Trampolines, All Alike

Part one brute forces the jumps. For part two we can make an observation that the jumps offsets will eventually flip flop between 2 or 3 starting from the beginning, for example:

    2 3 2 3 -1

The twos and threes can be represented in binary compact form, using 0 for 2 and 1 for 3:

    0101

We then precompute all possible combination for blocks of size 16, using this to accelerate part two.

Constants§

Functions§