# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def isSymmetric(self, root: TreeNode) -> bool:
def cmp(le,ri):
if le is None and ri is None:
return True
if le is None or ri is None or le.val !=ri.val:
return False
return cmp(le.left,ri.right) and cmp(le.right,ri.left)
if root is None:
return True
return cmp(root.left,root.right)