Pythagorean Distance Nodes in a Tree
Measure every node’s distance to three marked nodes with one breadth-first search each, then test whether the sorted triple of distances satisfies a squared sum rule.
Measure every node’s distance to three marked nodes with one breadth-first search each, then test whether the sorted triple of distances satisfies a squared sum rule.