LC: 1522. Diameter of N Ary Tree
https://leetcode.com/problems/diameter-of-n-ary-tree/
Last updated
https://leetcode.com/problems/diameter-of-n-ary-tree/
Last updated
Input: root = [1,null,3,2,4,null,5,6]
Output: 3
Explanation: Diameter is shown in red color.Input: root = [1,null,2,null,3,4,null,5,null,6]
Output: 4Input: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]
Output: 7/*
// Definition for a Node.
class Node {
public int val;
public List<Node> children;
public Node() {
children = new ArrayList<Node>();
}
public Node(int _val) {
val = _val;
children = new ArrayList<Node>();
}
public Node(int _val,ArrayList<Node> _children) {
val = _val;
children = _children;
}
};
*/
class Solution {
public int diameter(Node root) {
}
}