function IsBalanced_Solution(pRoot)
{
// write code here
if(!pRoot) return true;
return Math.abs(height(pRoot.left)-height(pRoot.right))<=1;
function height(node){
if(!node) return 0;
if(!(node.left) && !(node.right)) return 1;
return Math.max(height(node.left),height(node.right))+1;
}
}