# 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:
    	"""Purpose: Returns whether or not binary tree is symmetric 
    	around its root.
    	"""
        def isMirror(t1, t2):
            if not t1 and not t2:
                return True
            if not t1 or not t2:
                return False
            return t1.val == t2.val and isMirror(t1.right, t2.left) and isMirror(t1.left, t2.right)
    
        return isMirror(root.left, root.right)


     def isSymmetric1(self, root):
     	"""Returns same as above. 

     	Note: Cuts out unnecessary duplicate computation on root node.
     	"""
     	def isMirror(t1, t2):
            if not t1 and not t2:
                return True
            if not t1 or not t2:
                return False
            return t1.val == t2.val and isMirror(t1.right, t2.left) and isMirror(t1.left, t2.right)
    
        return isMirror(root.left, root.right)