class Solution:
def maxDepth(self, root: Optional[TreeNode]) -> int:
if root == None:
return 0
return max(self.maxDepth(root.left), self.maxDepth(root.right))+1
와 이때까지 easy들은 좀 봐줄라고 했는데 얘는 좀 재미가 없다..
class Solution:
def maxDepth(self, root: Optional[TreeNode]) -> int:
if root == None:
return 0
return max(self.maxDepth(root.left), self.maxDepth(root.right))+1
와 이때까지 easy들은 좀 봐줄라고 했는데 얘는 좀 재미가 없다..
댓글 0