mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-11 23:16:07 +00:00
fix preorder_traversal_iii_compact code
This commit is contained in:
@@ -20,8 +20,6 @@ func preOrder(root: TreeNode?) {
|
||||
if root.val == 7 {
|
||||
// 记录解
|
||||
res.append(path)
|
||||
path.removeLast()
|
||||
return
|
||||
}
|
||||
preOrder(root: root.left)
|
||||
preOrder(root: root.right)
|
||||
|
||||
Reference in New Issue
Block a user