int sums(TreeNode *root) { int sum = 0; if(!root) { return0; } if (root->left && !root->left->left && !root->left->right) { sum += root->left->val; } sum += sumOfLeftLeaves(root->left) + sumOfLeftLeaves(root->right);
returnsum; }
int sumOfLeftLeaves(TreeNode* root) { if(!root) { return0; } return sums(root);