LC: 1245. Tree Diameter
https://leetcode.com/problems/tree-diameter/
Last updated
https://leetcode.com/problems/tree-diameter/
Last updated
Input: edges = [[0,1],[0,2]]
Output: 2
Explanation:
A longest path of the tree is the path 1 - 0 - 2.Input: edges = [[0,1],[1,2],[2,3],[1,4],[4,5]]
Output: 4
Explanation:
A longest path of the tree is the path 3 - 2 - 1 - 4 - 5.class Solution {
public int treeDiameter(int[][] edges) {
}
}