Balanced Binary Tree Problem

Balanced Binary Tree Problem — ExecCode Medium DSA Practice

Solve the Balanced Binary Tree problem on ExecCode. Free online medium DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given a binary tree, determine if it is height-balanced: the depth of the two subtrees of every node never differs by more than one.

Examples

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

Constraints

0 ≤ nodes ≤ 5000 -10^4 ≤ Node.val ≤ 10^4

Practice Balanced Binary Tree free on ExecCode. Browse DSA problems, topic map, and placement guides.