mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 12:58:42 +08:00
fix preorder_traversal_iii_compact code
This commit is contained in:
@ -20,8 +20,6 @@ def pre_order(root: TreeNode):
|
||||
if root.val == 7:
|
||||
# 记录解
|
||||
res.append(list(path))
|
||||
path.pop()
|
||||
return
|
||||
pre_order(root.left)
|
||||
pre_order(root.right)
|
||||
# 回退
|
||||
|
||||
Reference in New Issue
Block a user