JavaScript Solution - DFS Approach (Last Updated 10/01/20)
\nvar subtreeWithAllDeepest = function(root) {\n    let height = 0;\n    let maxNode = null;\n    \n    dfs(root, 0);\n    \n    return maxNode;\n    \n    func
```\nvar subtreeWithAllDeepest = function(root) {\n    let height = 0;\n    let maxNode = null;\n    \n    dfs(root, 0);\n    \n    return maxNode;\n    \n    function dfs(node, currDepth) {\n        if (node == null) return currDepth - 1;\n        \n        height = Math.max(height, currDepth);\n        \n        const leftDepth = dfs(node.left, currDepth + 1);\n        const rightDepth = dfs(node.right, currDepth + 1);\n        \n        if (leftDepth == height && rightDepth == height) {\n            maxNode = node;\n        }\n        \n        return Math.max(leftDepth, rightDepth);\n    }\n};\n```
['Depth-First Search', 'JavaScript']