Short and concise C++ solution using DFS, 3~5 lines
cpp []\nint depth(TreeNode *root) {\n    return !root ? 0 : max(depth(root->left), depth(root->right)) + 1;\n}\n\nTreeNode* subtreeWithAllDeepest(TreeNode* root
```cpp []\nint depth(TreeNode *root) {\n    return !root ? 0 : max(depth(root->left), depth(root->right)) + 1;\n}\n\nTreeNode* subtreeWithAllDeepest(TreeNode* root) {\n    int d = depth(root->left) - depth(root->right);\n    return !d ? root : subtreeWithAllDeepest(d > 0 ? root->left : root->right);\n}\n```\n\nUpdate:\nSince some of you suggested that the original solution visits each node multiple times, I added below another version that addresses the issue at the cost of two additional lines.\n```cpp []\npair<int, TreeNode*> dfs(TreeNode *root) {\n    if (!root) return {0, nullptr};\n    auto [d1, r1] = dfs(root->left);\n    auto [d2, r2] = dfs(root->right);\n    return {max(d1, d2) + 1, d1 == d2 ? root : d1 > d2 ? r1 : r2};\n}\n\nTreeNode* subtreeWithAllDeepest(TreeNode* root) {\n    return dfs(root).second;\n}\n```
['Depth-First Search', 'C++']