parameters: (self, root)
return_statement: return dfs(root).node
docstring: :type root: TreeNode
          :rtype: TreeNode
docstring_summary: :type root: TreeNode
          :rtype: TreeNode
docstring_tokens: : type root : TreeNode : rtype : TreeNode
function: def subtreeWithAllDeepest(self, root):
          """
          :type root: TreeNode
          :rtype: TreeNode
          """
          Result = collections.namedtuple("Result", ("node", "depth"))
  
          def dfs(node):
              if not node:
                  return Result(None, 0)
              left, right = dfs(node.left), dfs(node.right)
              if left.depth > right.depth:
                  return Result(left.node, left.depth+1)
              if left.depth < right.depth:
                  return Result(right.node, right.depth+1)
              return Result(node, left.depth+1)
  
          return dfs(root).node
function_tokens: def subtreeWithAllDeepest ( self , root ) : Result = collections . namedtuple ( "Result" , ( "node" , "depth" ) ) def dfs ( node ) : if not node : return Result ( None , 0 ) left , right = dfs ( node . left ) , dfs ( node . right ) if left . depth > right . depth : return Result ( left . node , left . depth + 1 ) if left . depth < right . depth : return Result ( right . node , right . depth + 1 ) return Result ( node , left . depth + 1 ) return dfs ( root ) . node