Simple 0ms DFS PostOrder Solution.
The question simple wants to ask the lca of the deepest nodes, so what we are doing is, first we call and get the the deepest height of both the sides, and if t
The question simple wants to ask the lca of the deepest nodes, so what we are doing is, first we call and get the the deepest height of both the sides, and if they come the same and it is greater than the previous deepest height then this node is the lca and both deepest lie on either of its sides.\n\n```\n    TreeNode answer = null;\n    int curDepth = 0;\n    \n    public int lcaOfDeepest(TreeNode node, int level){\n         \n        if(node == null) return level;\n        \n        int leftDepth = lcaOfDeepest(node.left, level + 1);\n        int rightDepth = lcaOfDeepest(node.right, level + 1);\n        \n        if(leftDepth == rightDepth && leftDepth >= curDepth){\n            \n            curDepth = leftDepth;\n            answer = node;\n            return leftDepth;\n            \n        }\n        \n        return Math.max(leftDepth, rightDepth);\n        \n    }\n    \n    public TreeNode subtreeWithAllDeepest(TreeNode root) {\n        \n        lcaOfDeepest(root, 1);\n        return answer;\n        \n    }\n\n```
[]