@@ -0,0 +1,805 @@
+package SumofLeftLeaves;%0A%0A/**%0A * Find the sum of all left leaves in a given binary tree.%0A *%0A * Example:%0A * %3Cpre%3E%0A * 3%0A * / %5C%0A * 9  20%0A * /  %5C%0A * 15   7%0A * %3C/pre%3E%0A * There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24.%0A */%0Aclass TreeNode %7B%0A    int val;%0A    TreeNode left;%0A    TreeNode right;%0A%0A    TreeNode(int x) %7B%0A        val = x;%0A    %7D%0A%7D%0A%0Apublic class Solution %7B%0A%0A    private int sumOfLeftLeaves(TreeNode root, boolean isLeft) %7B%0A        if (root == null) return 0;%0A        if (root.left == null && root.right == null) %7B%0A            return isLeft ? root.val : 0;%0A        %7D%0A        return sumOfLeftLeaves(root.left, true) + sumOfLeftLeaves(root.right, false);%0A    %7D%0A%0A    public int sumOfLeftLeaves(TreeNode root) %7B%0A        return sumOfLeftLeaves(root, false);%0A    %7D%0A%7D

404. Sum of Left Leaves