[C++] Simple Solution
\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(0)
```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(0), left(nullptr), right(nullptr) {}\n *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}\n *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}\n * };\n */\nclass Solution {\n    int depthOfTree(TreeNode* root){\n        if(!root) return 0;\n        if(root->left == NULL && root->right == NULL) return 1;\n        else return(max(depthOfTree(root->left), depthOfTree(root->right)))+1;\n    }\n    void findNode(TreeNode* root, TreeNode*& result){\n        if(!root) return;\n        \n        int left = depthOfTree(root->left);\n        int right = depthOfTree(root->right);\n        \n        if(left > right){\n            findNode(root->left, result);\n        }\n        else if(right > left){\n            findNode(root->right, result);\n        }\n        else{\n            result = root;\n            return;\n        }\n    }\npublic:\n    TreeNode* subtreeWithAllDeepest(TreeNode* root) {\n        TreeNode* result = NULL;\n        findNode(root, result);\n        return result;\n    }\n};\n```
[]