Calling all Racers for the Alteryx Grand Prix! It's time to rev your engines and race to the stage at Inspire! Sign up here.

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2022 Day 18 (BaseA Style)

Alteryx Community Team
Alteryx Community Team
Discussion thread for day 18 of the Advent of Code -
16 - Nebula
16 - Nebula

It was difficult today! I wandered around for hours because I couldn't fix the bug.


Part 1: I did it dividing xy axis and z axis.

Part 2 : I made a big water tank and simulated a situation of water erosion. In other words, it searches for adjacent space (water) from the surrounding walls(water tank) and terminates when it reaches the cubes. The rest is done by using the solution from Part 1.

By the way, it took long time to simulate the flooding due to a simple logic bug.


Part 2 macro : flooding




8 - Asteroid

P1 was rather straightforward and working on P2 now.

I broke P1 into x,y,z then created a lookup table with sides and point numbers (based off the formula created)mmontgomery_0-1671374936005.pngmmontgomery_1-1671374944727.pngmmontgomery_2-1671374953756.png




17 - Castor

Part 1 was nice today... Need to wrap my head around part 2 but have to hop off my laptop for a bit so will come back to it later!


13 - Pulsar
13 - Pulsar

I liked this challenge


The trick for me on part 2 was removing the group of air droplets accessible from the outside. I expanded the min and max boundaries of the drop and removed the largest continuous group of drops. Took me a while to figure out that there were two types of air drops: those completely surrounded by lava and those touching other internal air drops. My input data has a cluster of 1000+ internal air drops.

Screen Shot 2022-12-18 at 9.08.24 AM.png
13 - Pulsar
13 - Pulsar

It was good to wake up today with one that I finally felt comfortable with (well it turns out for part 1 at least), to get back into the pattern - a lot of catching up to do on the missed days!




For part 2 I got a solve which works for the example, but based on previous days the example doesn't cover all scenarios so I need a bit more work on that.



Check out my collaboration with fellow ACE Joshua Burkhow at
13 - Pulsar

Only Part1 is completed.



17 - Castor
17 - Castor

One of my favorites this year.

Part1 was pretty easy just generating all the faces and seeing if they matched another face. For Part2, I thought of each cube of space as a cube and combined it all using the make group tool (ie is cube of space A is connected to cube of space B, and B connected to C, then the make group puts A,B,C into a single group). 


11 - Bolide

easy for part 1.

part 2 is tricky as example is not that detail.

keep using outer join and generate 6 sides.


generate 6 side +1 for each.
outer join with lava.


find closed area, instead of closed spot.

1. generate whole 20x20x20
2. generate 6 side for each point as well.
3. compare lava with x. y and z axis. to identify whether it blocked.



now, we have list of open and closed point (directly, have lava in front of all 6 sides.).
to settle the indirect open point, I used influence method, which
create a loop macro to check if one of the sides is open, change to open.

now we have a cleaned closed point, we just need to outer join against the part1 answers.  





17 - Castor
17 - Castor

Started out by trying to do this using Spatial, but it turned out to be easier to do with a simple iterator.


Part 1:
- the solution here is to generate every neighbour cell of an existing cell - there should be one for each face (6)
- if the generated neighbour cell exists in the original set - then this face was never visible
... only odd thing here is that you're not generating ALL neighbours - only those facing a face (i.e. the 3d manhattan distance is exactly 1)

Part 2:
Part 2 asks that you exclude any surfaces that are internal only (holes)
.... so - if you can figure out the internal holes - and add them back into the set - then part 1 works (and just gives you external faces)

So - 4 part solution:
a) generate every single cell around and within the blob (I added a 1 cell boundary)
b) working from the outside - move to every cell that you can see.    After a few iterations, this separates the cells into outside; rock; and inside
c) add the inside to the rocks to make it a solid object (no internal holes)
d) then just apply part 1 - and the answer pops out like magic

parse & bulk out the data....



Walk from the edges to find everything visible from outside


Joining it all together