143. Balanced Binary Tree

Given the root of a binary tree root. Return true if the tree is height-balanced: for every node, the height difference between the left and right subtrees is at most 1.
Example 1
Input: root = [1,2,2,3,3,null,null,4,4]
Output: false
Explanation: A deep subtree creates imbalance.
Example 2
Input: root = [3,9,20,null,null,15,7]
Output: true
Explanation: Height difference between subtrees does not exceed 1.
binary search treebinary treeeasyrecursiontree
JavaScript
Loading...
Line 1, Char 1