Swift tuple
\nclass Solution {\n    func subtreeWithAllDeepest(_ root: TreeNode?) -> TreeNode? {\n        return deep(root).1\n    }\n\n    func deep(_ root: TreeNode?) -> 
```\nclass Solution {\n    func subtreeWithAllDeepest(_ root: TreeNode?) -> TreeNode? {\n        return deep(root).1\n    }\n\n    func deep(_ root: TreeNode?) -> (Int, TreeNode?) {\n        if root == nil { return (0, root)}\n        let l = deep(root?.left) ,r = deep(root?.right)\n        let d1 = l.0 , d2 = r.0\n        return (max(d1, d2)+1, d1==d2 ? root : d1>d2 ? l.1 : r.1)\n    }\n}\n```
[]