This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
To be honest, I'm still not sure why my last fix gave me the right answer. I had to switch my labels in my initial join for "up", "down", "left", and "right". Here are some logic highlights from my workflow: - Joining and filtering based on coordinates - Only including coordinates where the adjacent value is smaller than the current value - I realized belatedly that every value except 9 should belong to a basin - Make Group! That tool was my downfall in the Grand Prix, so I feel that I've partially redeemed myself by recognizing and using it successfully here
I've included pictures of my workflow and what the basins graph looked like for my correct answer. I divided all my coordinates by 10 so the earth's curvature didn't distort the graph.
I spent too long on the first part. I kept getting the wrong answer and couldn't work out what the issue was. Original plan was to use multi-row but added to the fact I wasn't getting the logic as I expected, I didn't like this approach as it wasn't easy to switch between example and input, for example needing to code +/- 10 and 100 respectively.So I ended up building out the logic in a more structured way with joins to find the up, down, left, right positions.
For part 2 it was much quicker building out an iterative macro finding the nearest point for each low point and working outwards from that until you hit the wall of 9's.
Then just because I can't get enough of AoC I thought there would be a spatial solution to this. So for each point created a trade area (without overlaps) and then removed the points with a depth of 9. This then left me with needing to create combined polygons for these points and I recalled how @jarrod used Make Groups in the Grand Prix in 2020. I like this approach as you get a nice visual representation of the basins.
It's only after posting that I notice that @clmc9601 did a similar approach using make groups as the first poster of the day! 👏👏👏
Chris Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com