Module aoc::year2019::day02

source ยท
Expand description

ยง1202 Program Alarm

Substituting symbols instead of numbers into the program shows that it calculates the value of

a * noun + b * verb + c

We can isolate the value of the constants a, b, c in order to speed up subsequent calculations.

As the equation is monotonically increasing in both noun and verb, we can efficiently solve part two by binary searching in two dimensions, instead of a slow brute force check of all possible 10,000 combinations.

Functionsยง

Type Aliasesยง