Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2022 Day 18 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team
Discussion thread for day 18 of the Advent of Code - https://adventofcode.com/2022/day/18
9 REPLIES 9
AkimasaKajitani
17 - Castor
17 - Castor

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

 

Spoiler
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.

AkimasaKajitani_0-1671360164257.png

Part 2 macro : flooding

AkimasaKajitani_1-1671360205531.png

 

 

mmontgomery
11 - Bolide
11 - Bolide

P1 was rather straightforward and working on P2 now.

Spoiler
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

 

 

 

DataNath
17 - Castor
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!

 

Spoiler
DataNath_0-1671375364532.png
clmc9601
13 - Pulsar
13 - Pulsar

I liked this challenge

 

Spoiler
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
cgoodman3
14 - Magnetar
14 - Magnetar

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!

 

 

Spoiler
cgoodman3_0-1671396598822.png


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.

 

 

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
DaisukeTsuchiya
14 - Magnetar

Only Part1 is completed.

Spoiler
DaisukeTsuchiya_0-1671407878825.png

 

patrick_digan
17 - Castor
17 - Castor

One of my favorites this year.

Spoiler
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). 
patrick_digan_0-1672836551644.png

 

PangHC
12 - Quasar

easy for part 1.

part 2 is tricky as example is not that detail.

keep using outer join and generate 6 sides.

 

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

Pang_Hee_Choy_0-1673508685236.png

part2:
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.

Pang_Hee_Choy_1-1673509138283.png

 


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.  

Pang_Hee_Choy_2-1673509163529.png

 

 

 

SeanAdams
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.

 

Spoiler
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....

SeanAdams_0-1673903701760.png

 

Walk from the edges to find everything visible from outside
SeanAdams_1-1673903813231.png

 

Joining it all together
SeanAdams_2-1673903880744.png

 






Labels