Skip to content

Commit 842796a

Browse files
committed
q1382
1 parent ebac95e commit 842796a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tree/q129.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl Solution {
6363
}
6464

6565
pub fn sum_numbers(root: Option<Rc<RefCell<TreeNode>>>) -> i32 {
66-
fn helper2(r: Option<Rc<RefCell<TreeNode>>>, p: i32) -> Vec<i32> {
66+
fn h(r: Option<Rc<RefCell<TreeNode>>>, p: i32) -> Vec<i32> {
6767
let mut nums = vec!();
6868
if let Some(v) = r {
6969
let val = RefCell::borrow(&v).val + 10 * p ;
@@ -72,8 +72,8 @@ impl Solution {
7272
if left_child.is_none() && right_child.is_none() {
7373
nums.push(val);
7474
} else {
75-
nums.extend(Solution::helper2(left_child, val));
76-
nums.extend(Solution::helper2(right_child, val));
75+
nums.extend(h(left_child, val));
76+
nums.extend(h(right_child, val));
7777
}
7878
}
7979
nums

0 commit comments

Comments
 (0)