This commit is contained in:
krahets
2023-12-18 23:59:56 +08:00
parent b021b607ea
commit 60f0f80df6
4 changed files with 9 additions and 8 deletions

View File

@ -317,7 +317,7 @@ comments: true
*path = append(*path, root)
if root.Val.(int) == 7 {
// 记录解
*res = append(*res, *path)
*res = append(*res, append([]*TreeNode{}, *path...))
}
preOrderII(root.Left, res, path)
preOrderII(root.Right, res, path)