Statement
Given an undirected tree with edges
where
The diameter of a tree is the number of edges in the longest path between any two nodes.
Constraints:
n
edges.length
edges[i].length
= 21
0
Given an undirected tree with edges
where
The diameter of a tree is the number of edges in the longest path between any two nodes.
Constraints:
n edges.length
edges[i].length
= 2
1
0
Given an undirected tree with edges
where
The diameter of a tree is the number of edges in the longest path between any two nodes.
Constraints:
n edges.length
edges[i].length
= 2
1
0