Advent of Code 2024 Day 5 (BaseA Style)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Discussion thread for day 5 of the Advent of Code - https://adventofcode.com/2024/day/5
- Labels:
- Advent of Code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
My solution involved a sneaky trick that helped solve part 1 and set me up nicely for part 2:
For part 2 I used an iterative macro to sort pages:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
D5 was tricky; more in the spoiler
P2 was similar-ish since I filtered to non-matches only. Then I did a reverse order on paths (originally did find/replace on name/value pair 26|58 but this time I did it reverse order 58|26, as an example that didn't match in the overall grouping.) Then I did a count of which values showed up in the first column most frequently, then added the most common result from the second column (last item), ordered them, took the median, self join and sum
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
More on this tomorrow, after sleep and some cleanup but if you have a part 1 that works for the sample data but not the real data,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Solved!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
a good challenge.
for the rest, get the middle data and sum it.
part2: use iteration macro for logic in part 1. and adjust the position for the missout part by exchange the position i.e. "29, 13" to "13, 29". just pair by pair per recordID. Iterate until fully sort.
To get the answer for part 2, use iteration.number >0 to remove the part1 answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Couldn't really explain to you why the Part 2 iterative macro logic worked... but it worked!
For Part 2, I accidentally stumbled upon something that worked... I think it has something to do with seeing which values only show up in the "before" page rules vs. the "after" page rules, then whittling those down until there's no rules left? So like if page 13 only shows up in the "before" column, that means it's the first page... same if 89 only shows up in the "after" column, that means it's the last page... and then if you remove that from the list, you'll have a new "last page" left in the rules that remain? I think? It's late, I'm not actually sure, but that sounds pretty legit. 😂 
Today's "new Designer feature" win: Using GetPart formula (with a count of delimiters / 2 for the index) to find the middle value!
NJ
Sr. Manager, Product Management, Designer
Alteryx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Since now I can't fall asleep... decided to come post this now while I'm still up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
