/*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val) {
val = _val;
}
Node(int _val, vector<Node*> _children) {
val = _val;
children = _children;
}
};
*/
class Solution {
public:
int getDeep(Node* root){
if(root==NULL) return 0;
int maxV=-1;
int cur=-1;
for(int i=0;i<root->children.size();i++){
cur=getDeep(root->children[i]);
if(maxV<cur) maxV=cur;
}
int deep=1+maxV;
return deep;
}
int maxDepth(Node* root) {
if(root==NULL) return 0;
return getDeep(root)+1;
}
};