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 -1The twos and threes can be represented in binary compact form, using 0 for 2 and 1 for 3:
0101We 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