/** * 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; }