Balanced Binary Tree
Easy
Trees
Tree
DFS
Given a tree as level-order array, determine if it is height-balanced.
Constraints
Nodes ≤ 5000
Examples
Example 1:
Input: 3 9 20 null null 15 7
Output: true
Example 2:
Input: 1 2 2 3 3 null null 4 4
Output: false
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console