Problem 2359 · Medium

Find Closest Node to Given Two Nodes

Each node has one outgoing edge, so walking from each start gives its distances; pick the shared node whose farther distance is smallest.

Open the interactive visualisation