Java + HashMap recursive Solution
```\nMap map = new HashMap<>();\n    public TreeNode subtreeWithAllDeepest(TreeNode root) {\n        //check the case if the both left subtree height == right s
```\nMap<TreeNode,Integer> map = new HashMap<>();\n    public TreeNode subtreeWithAllDeepest(TreeNode root) {\n        //check the case if the both left subtree height == right subtree height, if true return root else traverse left & right recursively to check for height\n        \n        if(root==null || (height(root.left)==height(root.right))) return root;\n        return subtreeWithAllDeepest(height(root.left)>height(root.right) ? root.left : root.right);\n    }\n    \n    public int height(TreeNode root){\n        if(root==null) return 0;\n        \n        //maintain the hashmap with nodes & its coresponding height\n        if(map.containsKey(root)) return map.get(root);\n        \n        map.put(root,1+Math.max(height(root.left),height(root.right)));\n        \n        return map.get(root);\n    }
[]