Skip to content

Commit

Permalink
Merge pull request #112 from deveshks/patch-issue-110-problem-9.4
Browse files Browse the repository at this point in the history
Fixed bug in get depth of Problem 9.4 for python #110
  • Loading branch information
metopa committed Nov 11, 2019
2 parents 02d415b + ea7cdd0 commit e506638
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def lca(node0: BinaryTreeNode,
node1: BinaryTreeNode) -> Optional[BinaryTreeNode]:
def get_depth(node):
depth = 0
while node:
while node.parent:
depth += 1
node = node.parent
return depth
Expand Down

0 comments on commit e506638

Please sign in to comment.