Skip to content

Commit b41a4a1

Browse files
committed
Runtime: 47 ms (Top 88.16%) | Memory: 16.3 MB (Top 23.73%)
1 parent 7e2cc18 commit b41a4a1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/M/Maximum Depth of Binary Tree/Maximum Depth of Binary Tree.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Runtime: 47 ms (Top 88.16%) | Memory: 16.3 MB (Top 23.73%)
12
class Solution(object):
23
def maxDepth(self, root):
34
"""
@@ -8,11 +9,11 @@ def maxDepth(self, root):
89
depths = []
910
self.handler(root, result, depths)
1011
return max(depths)
11-
12+
1213
def handler(self, root, result, depths):
1314
if root:
1415
result += 1
1516
self.handler(root.left, result, depths)
1617
self.handler(root.right, result, depths)
1718
else:
18-
depths.append(result)
19+
depths.append(result)

0 commit comments

Comments
 (0)