Easy

Quiz

#110 Balanced Binary Tree

APPROACH

Given a binary tree, return whether it is height-balanced — meaning the heights of the left and right subtrees of every node differ by at most one.

Example 1:

Input: root = [3,9,20,null,null,15,7]
Output: true

Example 2:

Input: root = [1,2,2,3,3,null,null,4,4]
Output: false

Example 3:

Input: root = []
Output: true
1 of 4
1:00

What is the optimal approach for this problem?