3
int closestMeetingNode(vector<int> &edges, int node1, int node2) {4
// special case, if node1 and node2 are same the answer will be itself5
if (node1 == node2) return node1;8
// distance vectors for node1 and node210
vector<int> m2(n, -1);16
// calculate distance from node117
while (node != -1 && m1[node] == -1) {25
// calculate distance from node2 while checking for the same node in26
// distance vector for node127
while (node != -1 && m2[node] == -1) {29
if (maxD > max(dist, m1[node])) {31
maxD = max(dist, m1[node]);32
} else if (maxD == max(dist, m1[node])) {33
if (ans > node) ans = node;