DFS C++ - <10 LOC
\npair<int, TreeNode*> f(TreeNode* root) {\n    if(root == nullptr) return {0, root};\n        \n    auto l = f(root->left);\n    auto r = f(root->right);\n    
```\npair<int, TreeNode*> f(TreeNode* root) {\n    if(root == nullptr) return {0, root};\n        \n    auto l = f(root->left);\n    auto r = f(root->right);\n        \n    if(l.first == r.first) return {1 + l.first, root};\n    else if(l.first > r.first) return {1 + l.first, l.second};\n    else return {1 + r.first, r.second};\n}\n    \nTreeNode* subtreeWithAllDeepest(TreeNode* root) {\n    return f(root).second;\n}\n```
[]