Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2020 - BaseA Style (Day 11)

Jean-Balteryx
16 - Nebula
16 - Nebula

Discussion thread for day 11 of the Advent of Code : https://adventofcode.com/2020/day/11

27 REPLIES 27
jdunkerley79
ACE Emeritus
ACE Emeritus

Not the fastest or cleanest for part 2...

 

Spoiler
Iterative macros all the way...
jdunkerley79_0-1607676346409.png


Part 2 (slow and messy :():

jdunkerley79_1-1607676401576.png

 

 

 

AdamR_AYX
Alteryx Alumni (Retired)

I've not solved it yet, but if anyone wants more background reading this is a modified version of Conway's Game of Life which I did play once before in Alteryx 🙂

 

https://www.youtube.com/watch?v=hcrVS5YOrm4&feature=emb_title

Adam Riley
https://www.linkedin.com/in/adriley/
dsmdavid
11 - Bolide

I'm almost embarrassed by those ugly generate rows. Almost.

Spoiler
Alteryx_Day_11.png

 Same iterative solves both, just update the rows that enter it. 

AdamR_AYX
Alteryx Alumni (Retired)

At last a spatial problem!

 

Spoiler
AdamR_0-1607683350230.png


Base workflow

AdamR_1-1607683373771.png


Iterative Macro

AdamR_2-1607683395194.png


Part 2 is going to need a refactor!

 

Adam Riley
https://www.linkedin.com/in/adriley/
AdamR_AYX
Alteryx Alumni (Retired)

And here it is after the refactor 🙂

 

Spoiler
Pretty spatial data
AdamR_1-1607691592870.png


Parent workflow

AdamR_2-1607691634744.png

Iterative Macro

AdamR_3-1607691668912.png

 

 

Adam Riley
https://www.linkedin.com/in/adriley/
Balders
11 - Bolide

One macro for both parts for me. My hint would be to work out your seat pairings list before iterating through the occupancy changes.

 

Spoiler
Main workflow. Creating the seat pairs was for part 2 was long a took a little debugging. One missed tickbox on a multi-row grouping had me stumbling for a while.

A few notes on the solution:

- I used row and col fields to find seat pairings, but then combined those into a single seatid field before going into the macro.
- I added ring of empty "." spaces around the room to avoid wraparound issues on the edges.
- Once spaces have been given an ID, empty "." are not needed in the iteration checks, they always stay "." and don't affect seating choices so they're filtered out before going into the macros or working out the next seat in part 2. 

d1f132a7-273b-4982-9bc2-0c1fcbad7927.png

Iterative Macro. Half of the tools here are just creating a proper escape for the iterations as opposed to pair matching.Screenshot 2020-12-11 130138.png
patrick_digan
17 - Castor
17 - Castor

Mine was a mess today, but I got there in the end.

Spoiler
Part 2. My macro isn't complicated, but the price I pay is time. Part 2 took 5 minutes in its entirety. I spilt it into 2 parts. 1 part in the main workflow figures out where each seat needs to check (brute force), and then the iterative macro does all of the iterations (again, very brute force). 

i used my normal approach with these AOC problems using a single long string. It makes it fairly easy to work with and bebug, but It just isn't performant when you have to replicate the string a bunch. Glad this one's behind me solved. I'm sure the Alteryx Abacus would make it much more performant.
patrick_digan_0-1607694299134.png
patrick_digan_1-1607694320502.png

 

 

NedHarding
7 - Meteor

Mine was way to messy and hacked together for me to post...  Wasn't that hard in theory, in practice it drove me crazy debugging it.

peter_gb
9 - Comet

Quite happy with mine, my final solution makes up for the nightmare mis-read of part 1! Didn't resort to reddit or here today 🙂
I had to leave this for a while to go and work after part 1 - wasted an hour by misinterpreting the part one as look 8 seats in each direction, not 8 seats, 1 in each direction.... DOH!

 

Iterative macro for part 1, then an iterative to prepare for part 2 by looking for the next seat in each direction for each seat as this doesn't change.

Then a modification of my part 1 macro to solve part 2. <1 min so not too horrible either.

Full

Spoiler
11.png

    

macro1

Spoiler
11_1.png

macro2 to prep part 2

Spoiler
11_2.png


macro 3 to solve part 2

Spoiler
11_3.png

  Edit - also had fun seeing how the seats filled up:-

Spoiler
11.png


https://public.tableau.com/profile/petergb#!/vizhome/Day11_16077110205010/AoCDay11

Labels