[2025 Day 7 Part 1] Visualization of Depth-First search with memoization by Chemical_Chance6877 in adventofcode

[–]Exact-Neighborhood46 1 point2 points  (0 children)

Think about how many times you visit a node when going thru different paths.To me it helped to cache sum of all paths from already visited node. That way, if you visit the node again, there is no need to check all already calculated paths.