https://adventofcode.com/2025/day/8 Given a list of junction boxes' coordinates we have to find the closest junction box pairs then we have to figure out the circuit lengths. I tried with the naive set based approach initially but that didn't work out for the actual input but worked for sample. Then I learned about this new concept (for me) - union find algorithm - from graph theory. Using that approach i was able to solve both parts easily. I heard of this algorithm but got to learn and use it now. Thanks to AoC :) It is essentially keeping track of bosses for each node - path compression helps as well. Using this idea we can merge sets with different bosses into one. https://github.com/Maheshkumar-novice/Advent-Of-Code-Solutions/tree/main/2025/Day-08 [Visualizations in the above code made using claude] AI Conversation Summary: Here is the complete retrospective of your journey through this puzzle. You went through a massive architectural evolution today, moving from a brute-force…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.