/**
* Definition for a Node.
* type Node struct {
* Val int
* Children []*Node
* }
*/funcmaxDepth(root*Node)int{ifroot==nil{return0}depth:=0for_,next:=rangeroot.Children{depth=max(depth,maxDepth(next))}returndepth+1}funcmax(a,bint)int{ifa>b{returna}returnb}