@@ -0,0 +1,511 @@
+%0Apublic class _337HouseRobberIII %7B%0A    public int rob(TreeNode root) %7B%0A        return findMax(root)%5B0%5D;%0A    %7D%0A    %0A    private int%5B%5D findMax(TreeNode root) %7B%0A    %09int%5B%5D max = new int%5B2%5D;%0A    %09if (root == null) return max;%0A    %09int%5B%5D l = findMax(root.left);%0A    %09int%5B%5D r = findMax(root.right);%0A    %09max%5B1%5D = l%5B0%5D + r%5B0%5D;%0A    %09max%5B0%5D = Math.max(max%5B1%5D, l%5B1%5D + r%5B1%5D + root.val);%0A    %09return max;%0A    %7D%0A    %0A%09public class TreeNode %7B%0A%09%09int val;%0A%09%09TreeNode left;%0A%09%09TreeNode right;%0A%09%09TreeNode(int x) %7B val = x; %7D%0A%09%7D%0A%7D%0A

Add 337 solution