#
# @lc app=leetcode id=101 lang=python3
#
# [101] Symmetric Tree
#

# @lc code=start
# 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 isMirror(self, left: TreeNode, right: TreeNode) -> bool:
        if left == None or right == None:
            return left == right
        return left.val == right.val and self.isMirror(left.left, right.right) and self.isMirror(left.right, right.left)

    def isSymmetric(self, root: TreeNode) -> bool:
        return self.isMirror(root.left, root.right)
# @lc code=end


a2651dee1f7991a662b881504dcf22bf1ffd94e4
<mask token>

class Solution:
    <mask token>
    <mask token>

class Solution:
    <mask token>

    def isSymmetric(self, root: TreeNode) ->bool:
        return self.isMirror(root.left, root.right)

class Solution:

    def isMirror(self, left: TreeNode, right: TreeNode) ->bool:
        if left == None or right == None:
            return left == right
        return left.val == right.val and self.isMirror(left.left, right.right
            ) and self.isMirror(left.right, right.left)

    def isSymmetric(self, root: TreeNode) ->bool:
        return self.isMirror(root.left, root.right)

#
# @lc app=leetcode id=101 lang=python3
#
# [101] Symmetric Tree
#

# @lc code=start
# 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 isMirror(self, left: TreeNode, right: TreeNode) -> bool:
        if left == None or right == None:
            return left == right
        return left.val == right.val and self.isMirror(left.left, right.right) and self.isMirror(left.right, right.left)

    def isSymmetric(self, root: TreeNode) -> bool:
        return self.isMirror(root.left, root.right)
# @lc code=end

