Expand description
§Garden Groups
Solves both parts simultaneously by flood filling each region.
For part one we increment the perimeter for each neighboring plot belonging to a different region or out of bounds.
For part two we count the end of each straight side in the clockwise direction. A side ends when the next plot along it is outside the region (an outer corner), or the diagonal plot across the edge is inside the region (an inner corner).
Functions§
Type Aliases§
- Input 🔒