Balanced Binary Tree Check

00:00
EasyTreeDFSRecursion
TCSAmazon

Determine if a binary tree is height-balanced — for every node, the height of left and right subtrees differ by at most 1.

Examples

Input → [3,9,20,null,null,15,7]
Output → True
Input → [1,2,2,3,3,null,null,4,4]
Output → False
Input → []
Output → True