Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5d60667

Browse files
authored
Update 543-Diameter-of-Binary-Tree.py
whitespace is annoying
1 parent fb412ad commit 5d60667

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/543-Diameter-of-Binary-Tree.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
class Solution:
88
def diameterOfBinaryTree(self, root: TreeNode) -> int:
99
res = [0]
10-
10+
1111
def dfs(root):
1212
if not root:
1313
return 0
1414
left = dfs(root.left)
1515
right = dfs(root.right)
1616
res[0] = max(res[0], left + right)
17-
17+
1818
return 1 + max(left, right)
19-
19+
2020
dfs(root)
2121
return res[0]

0 commit comments

Comments
 (0)