```
public int sumOfLeftLeaves(TreeNode root) {
boolean isLeft = false;
int sum = 0;
return sumLeft(root,isLeft,sum);
}
public int sumLeft(TreeNode root,boolean isLeft,int sum)
{
if(root == null)
return sum;
if(root.left == null && root.right == null && isLeft){
sum+=root.val;
}
sum = sumLeft(root.left,true,sum);
sum = sumLeft(root.right,false,sum);
return sum;
}
```