class Solution:
def isSymmetric(self, root: TreeNode) -> bool:
def cur(L, R):
if not L and not R: return True
if not L or not R or L.val != R.val: return False
return cur(L.right, R.left) and cur(L.left, R.right)
if not root:
return True
return cur(root.right, root.left)