本题注意点:not root与root == None的区别,参考链接 https://blog.csdn.net/johinieli/article/details/80141757
class Solution(object):
def maxDepth(self, root):
"""
:type root: Node
:rtype: int
"""
if not root: return 0
if not root.children: return 1
return max([self.maxDepth(child) for child in root.children])+1