```
public class Solution {
public int sumOfLeftLeaves(TreeNode root) {
return helper(root, false);
}
public int helper(TreeNode node, boolean isLeft) {
if (node != null) {
if (isLeft && node.left == null && node.right == null) {
return node.val;
} else {
return helper(node.left, true) + helper(node.right, false);
}
} else {
return 0;
}
}
}
```