alteryx Community

# General Discussions

Discuss a wide range of topics! Questions about the Alteryx Platform should be directed to the appropriate Product discussion forum.

## Advent of Code 2021 Day 4 (BaseA Style)

16 - Nebula

25 REPLIES 25
13 - Pulsar
Spoiler

Fairly straight forward logic with this one, just a lot of tools to do it.

I found the work I did on the blog about trying to find the earliest you could complete a pack of Disney collectable cards I wrote influenced my approach with this one, as I straight away knew I could do it without an iterative macro.

Also nice that the solution to part two only needed a sample and sort added to solve the second part without needing to re-work the logic.

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
12 - Quasar

I'm looking forward to seeing more efficient solutions than this one!

Spoiler
I ended up with a brute force (rather than efficient) iterative macro. It found the solution, but it's not pretty. I just changed the filter logic to get the first bingo vs all bingos. Interface tools added later.

14 - Magnetar

Tool golf, this was certainly not. But I am super happy with how I ended up where I did - I had a vision at the start while reading through the problem about how I would need to build it, and more or less was able to build it out as I went along without too much going backwards to redo logic. ALSO I got to use my favorite dark horse tool - MAKE COLUMNS!! What a glorious end to the week.

Spoiler
A disturbing amount of appends and joins... but success!

Two days in a row of iterative macros... this is surely not going to end well. 🙂 Macro #1 for the winning Bingo card...

And Macro #2 for the losing Bingo card...

Cheers!

NJ

15 - Aurora

I could start on time today.

Spoiler
In macro2(for star2), I take the last 1 card but do not the win number. So I added the macro 1 after macro 2 and put into only last win card and calculate it like star1.

Macro1

Macro2

GitHub

11 - Bolide
Spoiler

Macro-less, should work for any (reasonable) size of the bingo board...

15 - Aurora

I'm inspired by @cgoodman3 and @dsmdavid, so I made not using macro version.

I think this approach is the same of @cgoodman3 and @dsmdavid .

Spoiler

After I made it without macros, I realized that it was very simple.
We can calculate when the card win very easily. Because it is that we join the order to each number in the bingo and then take max order at each row and column. After specifying the win card and the order, we can calculate the required result easily.
On the star2, we know the result easily by changing the sort way.

I should know the way before going to macro route.

GitHub

16 - Nebula
Spoiler
I wasn't happy with how part1 seemed to take me way too many tools, but I was pumped that part 2 was a simple copy paste.

7 - Meteor

Another iterative macro day! I spent WAYYYY too long working on Part2 yesterday (turns out I didn't read the directions thoroughly enough 😏) but today's was much smoother.

Spoiler

7 - Meteor

Another interesting one! Came up with a macroless solution. Should work for any sized bingo board.

Spoiler
1. I parsed out all the possible winning sequences (columns and rows)
2. Joined the values from the picked number string with their spot in the selection
3. For challenge 1 grouped by table and sequence to find the min step id per for a sequence
4. For challenge 2 used the same group by as in (3), and added another group by to get the table with the largest step id for it's first sequence.