@@ -0,0 +1,1058 @@
+package leetcode;%0A%0A/**%0A * https://oj.leetcode.com/problems/sum-root-to-leaf-numbers/%0A */%0Apublic class Problem129 %7B%0A    public static class 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%0A    public int sumNumbers(TreeNode root) %7B%0A        if (root == null) %7B%0A            return 0;%0A        %7D%0A        // this is a trick for using reference to%0A        // avoid having a member variable%0A        int%5B%5D result = new int%5B1%5D;%0A        sumNumbers(root, %22%22, result);%0A        return result%5B0%5D;%0A    %7D%0A    %0A    private void sumNumbers(TreeNode node, String accu, int%5B%5D result) %7B%0A        if (node == null) %7B%0A            return;%0A        %7D%0A        if (node.left == null && node.right == null) %7B%0A            int value = Integer.parseInt(accu + node.val);%0A            result%5B0%5D = result%5B0%5D + value;%0A            return;%0A        %7D%0A        sumNumbers(node.left, accu + Integer.toString(node.val), result);%0A        sumNumbers(node.right, accu + Integer.toString(node.val), result);%0A    %7D%0A%7D%0A

Solve problem 129