mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 16:54:50 +08:00
129求根节点的叶节点数字之和Java实现
This commit is contained in:
@ -168,7 +168,6 @@ Java:
|
||||
class Solution {
|
||||
List<Integer> path = new ArrayList<>();
|
||||
int res = 0;
|
||||
|
||||
public int sumNumbers(TreeNode root) {
|
||||
// 如果节点为0,那么就返回0
|
||||
if (root == null) return 0;
|
||||
@ -200,7 +199,6 @@ class Solution {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
public int listToInt(List<Integer> path){
|
||||
int sum = 0;
|
||||
for (Integer num:path){
|
||||
|
Reference in New Issue
Block a user