/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * }; */ class Solution { int ans = INT_MIN; public: int dfs(TreeNode* root){ if(root == nullptr) return 0; if(root->lef...