1 2 3 4 5 6 7 8 9 10 11
/** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ bool checkTree(struct TreeNode *root) { return root->left->val + root->right->val == root->val; }