#include <bits/stdc++.h> using namespace std; struct TreeNode{ TreeNode * left; TreeNode * right; TreeNode * parent; int val; TreeNode(){ left = NULL; right = NULL; parent = NULL; } }; void getRes(TreeNode * root, vector &node2val, int sum, int temp_sum, int &level ,int &res, unord...