Skip to content

Commit

Permalink
handle none case
Browse files Browse the repository at this point in the history
  • Loading branch information
ehdgua01 committed Nov 5, 2024
1 parent ca8ea07 commit c73d9cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion coding_test/leetcode/binary_tree_paths/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def backtrack(node: TreeNode):
backtrack(node.right)
stack.pop()

backtrack(root)
if root is not None:
backtrack(root)
return result


Expand Down

0 comments on commit c73d9cd

Please sign in to comment.