ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2025 Day 9 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 9 of the Advent of Code - https://adventofcode.com/2025/day/9

25 REPLIES 25
gawa
16 - Nebula
16 - Nebula

Alteryx spatial analysis really do great job!

Spoiler
image.png
Part1
Just calc area for all rectangular patterns and find max. It's simple task. Offset +1 is needed.
(ABS([X]-[Source_X])+1)*(ABS([Y]-[Source_Y])+1)​
Part2
Overall combined polygon is needed. My approach was to create new 3 points for each coordinate so it forms square, and trace each point individually to create sequence polygon. Then we will have 4 individual sequence polygon, so combine them into one. This is overall polygon map.
gawa_0-1765258815372.png

Here is how it looks like with my dataset.
image.png
Next, create all rectangular patterns as spatial polygon object as well, and find rectangular that are contained within overall polygon by the Spatial Match tool.
image.png
Once you get the target rectangular, then you just have to find the one with max area.

CoG
14 - Magnetar

@gawa, great explanation! This was a fun problem except for a misunderstanding that cost me a lot of time...

 

Spoiler
The Spatial Match Tool is not perfect. There can be overhangs from this tool. I had to include a Spatial Process Tool to be able to get the actual answer.

Hint: Graph the points to identify a pattern that is easier to search!

Screenshot.png
Tokimatsu
12 - Quasar

Spatial tool is good.

Spoiler
Logic is very simple. I created the box of each two points. When box forms just line, I used st_createline. Then processed.


スクリーンショット 2025-12-09 154736.png

スクリーンショット 2025-12-09 154755.png

 

Hub119
12 - Quasar
12 - Quasar

So it turns out (as we all know) where you place parentheses in an equation matters... strangely enough mistyping my area equation in part 1 didn't throw off my solution... it just became the bane of my existence in part 2 as I spent an hour plus looking in the wrong places to fix the problem.

Spoiler
One thing to note, as @CoG also called out, the spatial match tool has some issues with this problem, so in all my checking for fixes I ultimately got rid of it and just went straight to the spatial processing.
AoC 2025 D9 Pic.png
Raj
16 - Nebula

Realized I need to spend more time with spatial tools

Qiu
21 - Polaris
21 - Polaris

My brain hurts. @Hub119 Thank you for the tip about the Spatial Match tool.

Spoiler
AoC 2025 Day 09.png

 

DanFlint
8 - Asteroid

It's been ages since I've had a good reason to use spatial tools, I really enjoyed this one!

Spoiler
DanFlint_0-1765273110773.png
No need for spatial in part 1, just calculate side lengths.
Part 2 builds a shape which is only green and red tiles, then builds each possible rectangle. Spatial match to determine which rectangles are entirely within red and green tiles, then calculate the area in the same way as part 1.

 

martinson
11 - Bolide

I love a chance to use the Spatial Tools

Spoiler
martinson_0-1765274986990.png

 

Cheers,
martinson

LinkedIN

Bulien
PangHC
13 - Pulsar

wastes 3hrs for spatial tools. turn out I got chance to find the answer if I not confuse cut1_from2 and cut2_from1.



Labels
Top Solution Authors