Advent of Code 2024 - Day 12

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 2

  • @alecrim7k708
    @alecrim7k708 День тому

    Changing my approach from sides to corners really allowed me to solve part 2. Thanks for that!
    For part 1, I made it so that each node started at perimeter value 4 and decremented one for each neighbor.
    I maintained the same logic for part two with an added verification after visiting all the nodes. If the node had 1 neighbor, then it had 2 corners. Else if the node had 0 neighbors, it had 4 corners. Else, based on the position of neighbors I incremented the corner count starting from zero. Very verbose but got the job done.
    I hope to see how you finished your implementation.

  • @davidblake8612
    @davidblake8612 2 дні тому

    I do these challenges and then come and see how you did it. I never considered counting corners.