(root)
return maxlen
:type root: TreeNode
    :rtype: int
:type root: TreeNode
    :rtype: int
: type root : TreeNode : rtype : int
def longest_consecutive(root):
    """
    :type root: TreeNode
    :rtype: int
    """
    if not root:
        return 0
    DFS(root, 0, root.val)
    return maxlen
def longest_consecutive ( root ) : if not root : return 0 DFS ( root , 0 , root . val ) return maxlen