Python (Simple DFS)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def treeQueries(self, root, queries):\n        @lru_cache(None)\n        def height(node):\n            if not node:\n                return -1\n\n            return 1 + max(height(node.left),height(node.right))\n\n        dict1 = collections.defaultdict(int)\n\n        def dfs(node,depth,max_val):\n            if not node: return \n\n            dict1[node.val] = max_val\n\n            dfs(node.left,depth+1,max(max_val,depth+1+height(node.right)))\n            dfs(node.right,depth+1,max(max_val,depth+1+height(node.left)))\n\n        dfs(root,0,0)\n\n        return [dict1[i] for i in queries]\n\n\n\n        \n\n\n        \n\n            \n\n\n```
['Python3']