Module aoc::year2022::day15

source ·
Expand description

§Beacon Exclusion Zone

Structs§

Functions§

  • The example uses y=10 but the real data uses y=2000000, so break out the logic into a separate function to enable integration testing.
  • Similar to part one, the logic is broken out into a separate function to enable testing.
  • A beacon cannot be located with the the radius of a sensor unless it is the closest beacon.
  • The trick to solving this efficiently is to first rotate the corners of the diamond scanner shape by 45 degrees. This tranforms them into squares that make it much easier to find the missing distress beacon.