simple py solution - beats 100%, same solution as problem 1123
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
# Definition for a binary tree node.
# class TreeNode:
#     def __init__(self, val=0, left=None, right=None):
#         self.val = val
#         self.left = left
#         self.right = right
class Solution:
    def subtreeWithAllDeepest(self, root: Optional[TreeNode]) -> Optional[TreeNode]:
        def lca(root):
            if not root:
                return (0, None)
            d_l, l_lca = lca(root.left) # d_l = depth_left
            d_r, r_lca = lca(root.right) # d_r = depth_right
            if d_l == d_r:
                return d_r + 1, root

            return (d_r + 1, r_lca) if d_l < d_r else (d_l + 1, l_lca)
        
        return lca(root)[1]
```
['Python3']