Discussion thread for day 12 of the Advent of Code - https://adventofcode.com/2024/day/12
take me awhile to remember how to use "Make Group" tool. save time from build manualy.
thanks for past events got similar questions.
I applied spatial analysis to both part 1 & 2. It was hard to solve for me.
Very cool problem with application in (ML) Image Processing for edge detection.
V2 (no macro; thanks to the very powerful Make Group Tool + a lot of simplification throughout the workflow):
I did not use macros. For P2, I struggled by drawing diagrams in Excel.
For P1, I grouped adjacent elements using the "Make Group" Tool. A single plant would have fences on all four sides, but if it is adjacent to others, the shared sides are subtracted in the calculation.
For P2, I took the approach that irregularities (convexities or concavities) add more edges, and I calculated the edges by dividing the analysis into vertical and horizontal directions.
I got stuck with Part 2 and got a hint from @gawa that Spatial Tools works, and it actually worked. Thanks gawa-san!
Spatial Tools are very powerful in "visualizing" the process.👍
I hadn't come across the Make Group tool before but it did exactly what I needed for this challenge when I was struggling to identify the area and perimeter of distinct groups. I didn't use any macros as I was able to find and check the values of adjacent cells using Generate Rows. I did find Part 2 very tricky and was originally considering a convoluted method to try and count the number of corners (because corners = edges), but couldn't wrap my head around the best way to do that. In the end... (see spoiler)
Solved!
Fun use case for spatial tools today 😀