문돌이 존버/프로그래밍 스터디
2021. 10. 1.
(leetcode 문제 풀이) Balanced Binary Tree
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the left and right subtrees of every node differ in height by no more than 1. Constraints: The number of nodes in the tree is in the range [0, 5000].-104 1: return -1 return max(left, right) + 1 def isBalanced(self, root: Optional[TreeNode]) -> bool: retu..