/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * }; */ class Solution { private: int res = 0; void dfs(TreeNode* node, int target, int cursum) { if (node == nullptr) ret...