We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd9a296 commit 457b394Copy full SHA for 457b394
maximum-depth-of-binary-tree/doh6077.py
@@ -1,4 +1,5 @@
1
2
+# Time: O(n)
3
# Maximum Depth of Binary Tree
4
class Solution:
5
def maxDepth(self, root: Optional[TreeNode]) -> int:
@@ -8,6 +9,4 @@ def maxDepth(self, root: Optional[TreeNode]) -> int:
8
9
right = self.maxDepth(root.right)
10
11
return 1 + max(left, right)
-
12
- # Time: O(n)
13
0 commit comments