I have a habit of using A LOT of tools it would appear but I really like seeing each step of the way and being certain the logic is working the way I'm visualising the problem in my head. Need to dig into some other solutions to see how they've possibly been done more efficiently than my works of art 🤣 🎅
A closer look :
Focused on creating categories for each point (left, right, up, down) with help of generate rows. For P1, I created a boundary with values of -1 to count those. For P2, took me a while, but had to bucket each category. Got values greater than no problem, just had to do running total and first record on current point then union.
Part 2 Macro:
Workflow:
Another day, another unnecessary and hideous macro. I'm having fun nobody can stop me
That felt inelegant
Finally got today's done! Spent 2.5 hours trying to debug my macros only to realise I was leaving my RecordID field in my 'left' count...
Column movement checker:
Row movement checker:
Scraping by now, just want the answer, not care about the efficiency anymore 😅
1. split to x,y coordination. create for list x and y.
2. use left for top, left. and right for down, right
3. use regex_countmatches to count more than 1
4. merge with edge and count record.
part2:
1. get the list.
2. remove unnecessary item, descending and compare
3. sum the count and get result.
Super messy solution - well at least the weekend is ahead, and time for refactoring ...
Teh data prep separates this in to row-wise and column-wise trees.
The second phase then does a simple check and counts
This is the macro in the middle the processes ever subset of the strings:
Part 2 is just a slightly different sum on the same data