Problem
You get the root root of a binary tree. In a binary tree, each node has at most two children: a left child and a right child.
Return true if the tree is height-balanced. Otherwise, return false.
The left subtree of a node is its left child and all the nodes below that child. The right subtree of a node is its right child and all the nodes below that child.
The height of a tree is the number of nodes on its longest path from the top node to a leaf. A leaf is a node with no children. An empty tree has the height 0.
A tree is height-balanced when, at each node, the heights of the left subtree and the right subtree differ by 1 or less.
The examples show each tree as a list in level order. This list gives the nodes row by row, from left to right. The value null marks a missing child.
Example 1
- Input:
- root = [3,1,7,null,2]
- Output:
- true
- Explanation:
- At the root, the left subtree has the height 2 and the right subtree has the height 1. At each other node, the difference is also 1 or less.
Example 2
- Input:
- root = [5,4,null,3]
- Output:
- false
- Explanation:
- At the root, the left subtree has the height 2 and the right subtree is empty. The difference is 2.
Example 3
- Input:
- root = [1,2,3,4,null,null,5,6,null,null,7]
- Output:
- false
- Explanation:
- At the root, both subtrees have the height 3. But at node
2, the left subtree has the height 2 and the right subtree is empty.
Constraints
- 0 <= number of nodes <= 5000
- -10^4 <= Node.val <= 10^4
SysRound wrote this statement. A reference solution checks every example.
Related questions
Continue with questions that share topics or the same question type.
- All Nodes Distance K in Binary Tree
Coding · Binary Tree · Breadth-First Search · Depth-First Search
- Amount of Time for Binary Tree to Be Infected
Coding · Binary Tree · Breadth-First Search · Depth-First Search
- Binary Search Tree to Greater Sum Tree
Coding · Binary Search Tree · Binary Tree · Depth-First Search
- Binary Tree Cameras
Coding · Binary Tree · Depth-First Search · DP on Trees
Sources · 2 references
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 110. Balanced Binary Tree
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source
LeetCode company tags · 1 record
Anduril
Balanced Binary Tree
Reported date not specified · Source window: 6mo
Source snapshot: Oct 20, 2026
Source frequency score: 65.6. This is not an interview probability.
View source