functionIsBalanced_Solution(pRoot) { if(pRoot === null) returntrue; let l = getTreeDeep(pRoot.left); let r = getTreeDeep(pRoot.right); returnMath.abs(l-r)<=1 && IsBalanced_Solution(pRoot.left) && IsBalanced_Solution(pRoot.right); } functiongetTreeDeep(root){ if(root===null) return0; let left = getTreeDeep(root.left); let right = getTreeDeep(root.right); return1 + (left>right?left:right); }