Module day05

Module 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 combinations for blocks of width 16, using this to accelerate part two.

Functions§

compute_block 🔒
parse
part1
Brute force implementation.
part2