var isSymmetric = function (root) {
if (!root)
return false
function check(leftTree, RightTree) {
if (leftTree == null && RightTree == null)
return true
else if (leftTree != null && RightTree != null) {
if (leftTree.val == RightTree.val)
return check(leftTree.left, RightTree.right) && check(leftTree.right, RightTree.left)
else
return false
} else
return false
}
return check(root.left, root.right)
};