2025/01/15 4

DFS: 111. Minimum Depth of Binary Tree

111. Minimum Depth of Binary Tree if not root: 루트 비어 있는 경우    return 0 : 깊이는 0 root 부터, 깊이는 1 자식이 둘다 없으면 leaf 노드 임if not node.left and not node.right:   return 깊이 최소 값 업데이트 # Definition for a binary tree node.# class TreeNode:# def __init__(self, val=0, left=None, right=None):# self.val = val# self.left = left# self.right = rightclass Solution: def minDepth(self, r..