Discussion thread for day 5 of the Advent of Code - https://adventofcode.com/2024/day/5
My solution involved a sneaky trick that helped solve part 1 and set me up nicely for part 2:
D5 was tricky; more in the spoiler
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,
Solved!
a good challenge.
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!
Since now I can't fall asleep... decided to come post this now while I'm still up.