Balanced Binary Tree
Check if tree is height-balanced
Code (Python)
......2 def __init__(self, val=0, left=None, right=None):3 self.val = val4 self.left = left5 self.right = right6 7class Solution:● def isBalanced(self, root) -> bool:9 def check(node):10 if not node: # null leaf has height 011 return 012 13 left = check(node.left)14 if left == -1: # early exit - left unbalanced......Current Line (7): Function Entry
Traversal Progress
Recursion Stack
Stack is empty. Click Next to begin!