[Python3, C++] Clean 9 lines Dfs
Explanation:\n Find height of each node\n Perform a dfs, the parameters are current node, current depth and max height without current node\n Max height without
**Explanation**:\n* Find height of each node\n* Perform a dfs, the parameters are current node, current depth and max height without current node\n* Max height without current node will be max height elsewhere in the tree or height of sibling node + curr depth\n\n**Python3**\n```   \n    def treeQueries(self, root, queries, ans = {}) -> List[int]:\n        @cache\n        def height(r): return 1 + max(height(r.left), height(r.right)) if r else 0\n        def dfs(r, depth, mx):\n            if not r: return\n            ans[r.val] = mx\n            dfs(r.left, depth + 1, max(mx, depth + height(r.right)))\n            dfs(r.right, depth + 1, max(mx, depth + height(r.left)))\n        dfs(root, 0, 0)\n        return [ans[v] for v in queries]\n```\n**C++**\n```\nvector<int> treeQueries(TreeNode* root, vector<int>& queries) {\n\tunordered_map<int, int> ans; unordered_map<TreeNode*, int> hts; vector<int> res;\n\tfunction<int(TreeNode*)> height = [&](TreeNode* r) {\n\t\treturn r ? (hts[r] = 1 + max(height(r->left), height(r->right))) : 0; \n\t};\n\tfunction<void(TreeNode*,int,int)> dfs = [&](TreeNode* r, int depth, int mx) {\n\t\tif (!r) return;\n\t\tans[r->val] = mx;\n\t\tdfs(r->right, depth + 1, max(mx, depth + hts[r->left]));\n\t\tdfs(r->left, depth + 1, max(mx, depth + hts[r->right]));\n\t};\n\theight(root); dfs(root, 0, 0);\n\tfor (int& v: queries) res.push_back(ans[v]);\n\treturn res;\n}\n```\n*Time complexity: O(n)*\n\n**Bonus:**\n**Python3 8 lines**\n   ```\n\t def treeQueries(self, root, queries, ans = {}) -> List[int]:\n        ht = lru_cache(maxsize = 20000)(lambda r: 1 + max(ht(r.left), ht(r.right)) if r else 0)\n        def dfs(r, depth, mx):\n            if not r: return\n            ans[r.val] = mx\n            dfs(r.left, depth + 1, max(mx, depth + ht(r.right)))\n            dfs(r.right, depth + 1, max(mx, depth + ht(r.left)))\n        dfs(root, 0, 0)\n        return [ans[v] for v in queries]\n```
[]