Simple recursion with python (easy to understand) with explanation
In short if both child has same depth, you return parent otherwise you return child with the max depth.\n```\n# Definition for a binary tree node.\n# class Tree
In short if both child has same depth, you return parent otherwise you return child with the max depth.\n```\n# Definition for a binary tree node.\n# class TreeNode:\n#     def __init__(self, val=0, left=None, right=None):\n#         self.val = val\n#         self.left = left\n#         self.right = right\nclass Solution:\n    def findDepth(self, node):\n        if not node:\n            return 0\n        return 1 + max(self.findDepth(node.left), self.findDepth(node.right))\n    \n    def subtreeWithAllDeepest(self, root: TreeNode) -> TreeNode:\n        if self.findDepth(root.left) == self.findDepth(root.right):\n            return root\n        elif self.findDepth(root.left) > self.findDepth(root.right):\n            return self.subtreeWithAllDeepest(root.left)\n        else:\n            return self.subtreeWithAllDeepest(root.right)
['Recursion', 'Python']