/* function TreeNode(x) {
    this.val = x;
    this.left = null;
    this.right = null;
} */
function isSymmetrical(pRoot)
{
    // write code here
    if(pRoot === null){
      return true
    }
   return  isequel(pRoot.left,pRoot.right)
}
function isequel(left,right){
  if(left == null && right == null){
    return true
  }
  if(left === null || right === null ){
    return false
  }
  if(left.val !== right.val){
    return false
  }
 return  isequel(left.left,right.right) && isequel(left.right,right.left)
}
module.exports = {
    isSymmetrical : isSymmetrical
};