This commit is contained in:
bt3gl 2023-07-30 21:40:09 -07:00
parent 1d44d182e2
commit a85ed914d3
320 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,10 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: bt3gl
def max_depth(root: Optional[TreeNode]) -> int:
if root is None:
return 0
return max(max_depth(root.left) + 1, max_depth(root.right) + 1)