Discussion thread for day 14 of the Advent of Code - https://adventofcode.com/2023/day/14
I like any chance I get to use transformations and string parsing. Part 2 was a lot of trial and error, but I got there in the end (thank goodness for example data!).
Curious to see whether I'll manage more of these before Christmas - the holiday things are get busy around here!
P1 wasn't pretty and P2, well, ugly is an understatement to get the base loop to work. More in spoiler
update workflow with 40~ seconds.
REGEX_Replace([data], "(\.+)(O+)", "$2$1")
and filter it if the rows nothing to move.
hence, the iteration and data size are reduced, it speeds up 97%.
updated macro:
Satisfying to finally get the solution, and I think I lucked out with a data set that lent itself to clarity as to what was repeated in the pattern.
Anyone else find it easier to solve for part 2 using the real data instead of the test data?
To figure out the repeats, I basically looked where consecutive rows that appeared more than once started. The first one marked the starting point. Looked where that repeated to find how many records in a cycle, and then extrapolated that pattern to 1000000 to find the answer.
@phottovy - I'm sort of irritated with you for how nice and compactly you did the N/E/S/W bananas. I overcomplicated mine by a factor of 100 :D