[C++] DFS
\nclass Solution {\npublic:   \n    int depth(TreeNode *root) {\n        return !root ? 0 : 1 + max(depth(root->left), depth(root->right));\n    }\n\n    TreeNo
```\nclass Solution {\npublic:   \n    int depth(TreeNode *root) {\n        return !root ? 0 : 1 + max(depth(root->left), depth(root->right));\n    }\n\n    TreeNode* subtreeWithAllDeepest(TreeNode* root) {\n        int d = depth(root->left) - depth(root->right);\n        return d==0 ? root : subtreeWithAllDeepest(d > 0 ? root->left : root->right);\n    }\n};\n```\nreference:\nhttps://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/discuss/146842/Short-and-concise-C%2B%2B-solution-using-DFS-3~5-lines
[]