Discussion thread for day 5 of the Advent of Code - https://adventofcode.com/2023/day/5
My brain is dead, but boy was that a fun challenge and a great puzzle! Thinking through how to solve a problem of this magnitude was very exciting (... although I almost crashed my computer, jumping straight to the Generate Rows Tool... Next time I'll check how big the numbers are).
There may be many problems, but I solved them anyway.
Please don't ask me how my WF works, because I can't explain😂
0.9sec with AMP engine.
I refined my WF, and now, I can explain how it works. Happy to achieve less than 1 sec!
Part2 was so hard.
<Macro Part1>
< Macro Part2>
I feel good about my part 1 solve using my multi-row-field-column tool, but part 2 is one of those that you just find a way to solve and move on!
Attached is my sort of cleaned up workflow:
No macro and 1 second to run. Ironically got p2 in a much faster time than P1.
Had to rethink my strategy for part 2 to think in ranges rather than lists. Rough steps are:
1. Check if start of seed range is within one of the source ranges
2. If true, check if the end is within that source range
3. If yes, happy days, assign the offset for the next level
4. If no, break the range into two - the part that fits and the remainder
5. The remainder forms a new range on which to preform steps 1-4.
I used an iterative macro for steps 1-4 and then ran it for each mapping. Runtime 0.5 secs