Advent of Code 2023 Day 18 Solve

Поделиться
HTML-код
  • Опубликовано: 18 дек 2024

Комментарии • 3

  • @mlggeek1
    @mlggeek1 Год назад

    Well done! Also, making leaderboard at a PC방!? On vacation?

  • @mathiaskern7031
    @mathiaskern7031 Год назад

    If (x,y) is an original coordinate, add both x and x+1 to the set of x coordinates we want to compress (same for y). The compressed coordinate x_compressed represents the interval [x_orig[x_compressed], x_orig[x_compressed+1]), and the +1 part always exists for our original set of coordinates.

    • @nthistlethwaite
      @nthistlethwaite  Год назад +1

      Yep, this is correct - I think I confused myself by thinking about whether the boundary itself lies on the inside or outside of a compressed cell and how to count its area appropriately, but this is just wrong because the boundary itself is fully occupying a compressed cell of width 1 (not sure if that explanation of my self-confusion made sense haha). Thanks for posting this! When I get a chance I'll try to write up an alternative part 2 solution that uses this compression.