We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebac95e commit 842796aCopy full SHA for 842796a
src/tree/q129.rs
@@ -63,7 +63,7 @@ impl Solution {
63
}
64
65
pub fn sum_numbers(root: Option<Rc<RefCell<TreeNode>>>) -> i32 {
66
- fn helper2(r: Option<Rc<RefCell<TreeNode>>>, p: i32) -> Vec<i32> {
+ fn h(r: Option<Rc<RefCell<TreeNode>>>, p: i32) -> Vec<i32> {
67
let mut nums = vec!();
68
if let Some(v) = r {
69
let val = RefCell::borrow(&v).val + 10 * p ;
@@ -72,8 +72,8 @@ impl Solution {
72
if left_child.is_none() && right_child.is_none() {
73
nums.push(val);
74
} else {
75
- nums.extend(Solution::helper2(left_child, val));
76
- nums.extend(Solution::helper2(right_child, val));
+ nums.extend(h(left_child, val));
+ nums.extend(h(right_child, val));
77
78
79
nums
0 commit comments