class Solution {

public:

int sumOfLeftLeaves(TreeNode* root) {

int sum = 0;

```
if(!root) return sum;
preOrder(root, sum);
return sum;
}
void preOrder(TreeNode* root, int& sum) {
if(root) {
if(root->left != NULL && root->left->left == NULL && root->left->right == NULL)
sum += root->left->val;
preOrder(root->left, sum);
preOrder(root->right, sum);
}
}
```

};