Finally caught up on Day 12! Part 1 was incredibly quick to run... The time taken for part 2 to complete shall remain a secret other than to those that were present in the Alteryx friends & AoC virtual happy hour!
Batch macro to load in all a starts:
Iterative macro - generates possible next steps for the current tile until an end is met:
Part 1 was the same approach without the batch!
Edit: Upon reversing the logic and starting from the End - as suggested by @DavidP and others - my Part 2 actually ran in 18.6 seconds which is a whopping 1,490 times faster than my first attempt!
OK - so this took 1.5 days but it's done. Main snag was a silly logical error on part 2 where instead of running the part 1 once for each new starting point, I was running it once per each cell in each starting point.
Solution summary in spoiler below.
which looks like this:
BTW - using the cell ID instead of Row and Column comes in handy for speed.
This is pretty simple - it just takes every cell; joins it to each of its neighbours and checks if the move is valid ( based on height).
This gives you a simple list of which transitions from cell X to cell Y are allowed.
So - now we know the starting point, we know which moves are valid - now we just need to do the algo above:
Although this may look kinda complex - it's actually pretty practical:
I meant to post this earlier, but kept forgetting. Here it is, at last, the "reserve Dijkstra" macro that helps me solve both part 1 and part 2 together in 65 seconds :-) @Mildman
I used this same macro, with some modifications to solve for one or two other AoC too.
Cheers,
Dawn.
just submitting my backlog of old challenges