gary@interview:~/interview/coding/559-maximum-dept….md$
$ cat ./coding/559-maximum-depth-of-n-ary-tree.md
[Coding]

559. Maximum Depth of N-ary Tree

────────────────────────────────────────────────────────────

559. Maximum Depth of N-ary Tree

"""
# Definition for a Node.
class Node:
    def __init__(self, val=None, children=None):
        self.val = val
        self.children = children
"""

class Solution:
    def maxDepth(self, root: 'Node') -> int:
        if not root:
            return 0
        if not root.children:
            return 1
        return 1 + max([self.maxDepth(child) for child in root.children])

--tags#Tree
$ ls ./coding/ | grep -v 559-maximum-depth-of-n-ary-tree
265. Paint House II256. Paint House143. Reorder List1762. Buildings With an Ocean View
← cd ../codingcd ~