C++ : using recursion : 85% faster
```\nclass Solution {\npublic:\n    TreeNode subtreeWithAllDeepest(TreeNode root) {\n         if (root == NULL) return NULL;\n         int left = getDepth(root-
```\nclass Solution {\npublic:\n    TreeNode* subtreeWithAllDeepest(TreeNode* root) {\n         if (root == NULL) return NULL;\n         int left = getDepth(root->left);\n         int right = getDepth(root->right);\n        if (left == right) return root;\n        else if (left > right) return subtreeWithAllDeepest(root->left);\n        else return subtreeWithAllDeepest(root->right);\n    }\n    \nprivate :\n     int getDepth(TreeNode* node)\n     {\n         if (node == NULL) return 0;\n         return 1 + std::max(getDepth(node->left),getDepth(node->right));\n     }\n};
[]