Cast your vote for the official 2025 Inspire Pin! Designs were submitted by fellow Community members and reflect the creativity and passion of Alteryx users across the globe. Vote now!
Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2024 Day 8 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 8 of the Advent of Code - https://adventofcode.com/2024/day/8

20 REPLIES 20
CoG
14 - Magnetar

Eric is treating us right for the weekend! Very refreshing (Scored top 1000 for both parts today). Reading the problem felt harder than solving it:

 

Spoiler
Brute force all the way. Small map size makes this problem trivial to solve!
Main.png

 

ScottLewis
11 - Bolide

A second straightforward day in a row. Probably too much to hope for one more in advance of Monday Morning Meetings but we'll find out in 24 hours.

 

This marks the only time I've ever been happy that joins are case sensitive.

 

Spoiler
This is pretty much an intermediate data tricks lesson. Filter out junk, join with yourself to generate all possible combinations, throw out self joins, calculate the two antinodes from the two points (or the 50 possible for part 2) for each pair, unique the thing and count the rows. Bing. I missed that the possible count is N, rather than N/2 for part 2, which kept me out of the rarified triple digit air but otherwise this is a very good one for Alteryx.
gawa
16 - Nebula
16 - Nebula

Difficult part was to understand what we are asked to do rather than configuring WF today.

I might have violated Base-A...I used a pencil and paper. I love @CoG 's neat and wise WF. It's elegant.

Spoiler
Part1: Create all pair of the same antennas, and  calc X-Y of antinodes at opposite side. Once understanding the concept, it's not difficult.
Part2: I used linear algebra; Y = aX + b. By using intermediate result of part1, we can find two parameters 'a' and 'b' easily by the Formula tool. Cross join all of lines and points, and check points are on it. As 'a' and/or 'b' can be decimal, result of expression 'Y - (aX + b)' is not always exactly equal to 0 (0.0001234 etc). I applied fuzzy threshold like ABS([Y]-([a]*[X]+[b])) < 0.01, and it worked well in this case.

 (Edit) For part2, if linear algebra method is applied, it's successful because of:

I was just luck to have solved it without knowing this nature of data.

Spoiler
Span-X and Span-Y is relatively prime(互いに素) for any pair of antenna. Line between two antenna does not intersect any points within that range. 
That means the extended line outside of two antenna will Intersect points where they locate at multiple of Span-X/Y, that are we are asked to find.
DataNath
17 - Castor
17 - Castor

Wow - didn't expect this after some of the challenges we've had this week! Did almost have an absolute meltdown trying to parse the question originally though. Finished ~5k for both parts on the global leaderboard which is pretty sweet. Went overboard generating rows for P2 but hey ho, covering bases = stars apparently.

 

Spoiler
Day 8.png  

 

kelsey_kincaid
12 - Quasar
12 - Quasar

I'm sure someday I'll feel confident with grid problems, but I won't get there without practice! I spent a decent amount of time trying a spatial solution, but I didn't get very far with that.

 

I'm 100% sure I overcomplicated this one, but I was happy that Part 2 didn't take toooo long to get to from Part 1. 

 

Spoiler
I nested iterative macros within a batch macro, which is why I'm certain I overcomplicated it, but it still runs quickly which is nice. 
2024_Day8_KelseyKincaid_WF.png
Batch Macro: 
All this is doing is filtering down to antennae that have the same transmission value. I used REGEX_Match with case sensitivity to ensure the difference between 'a' and 'A' would be captured here.
2024_Day8_KelseyKincaid_Batch.png
Iterative Macro(s):
My part 1 and part 2 macros are identical except for the Generate Rows tool & a small tweak to the formulas.
I take each row of data and join it with every other row of data that has the same transmission value. Then it computes the location of each antinode.

The generate rows tool for Part 2 provides a multiplier. This lets me compute all of the points along the line that could possibly be within the specified size of grid. 
2024_Day8_KelseyKincaid_Iter.png

 

 

EDIT: Seeing the other (much simpler) solutions is a good lesson for me. Sometimes my mind jumps straight to macros for AoC and it doesn't need to! 

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

For Part 2, at first I tried "Generate Rows" or "Append Fields".

As it did not seem to work well, I switched to Iterative Macro and it worked.

 

Spoiler
Workflow
workflow.png
Macro for Part2
part2_macro.png
DaisukeTsuchiya
14 - Magnetar
14 - Magnetar

Done. I can sleep tonight.

Spoiler
スクリーンショット 2024-12-08 180603.png
AkimasaKajitani
17 - Castor
17 - Castor

Solved!

Not elegant, but work!

Spoiler
image.png

I was able to use the Arrange tool to stack multiple x,y elements vertically!

 

mmontgomery
11 - Bolide
11 - Bolide

Day8. More in spoiler

Spoiler
P1: Spent most of the time drawing the relationships by hand and then creating the formulas around the hand calcs to make it easier to see
P2: Take P1 framework but apply it to generate rows while setting boundaries relative to the map sizeP1.pngP2_P1.pngP2_P2.png
Labels
Top Solution Authors