Nice and clear 🟩🟩🟩 beats 89.91%
\n\n# Approach\n Describe your approach to solving the problem. \nNice and clear \uD83D\uDFE9\uD83D\uDFE9\uD83D\uDFE9 beats 89.91% \n\n# Complexity\n- Time comp
\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nNice and clear \uD83D\uDFE9\uD83D\uDFE9\uD83D\uDFE9 beats 89.91% \n\n# Complexity\n- Time complexity:O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(H)\n- where \'H\' is the height of the tree\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n# Definition for a binary tree node.\n# class TreeNode:\n#     def __init__(self, val=0, left=None, right=None):\n#         self.val = val\n#         self.left = left\n#         self.right = right\nclass Solution:\n    def isSymmetric(self, root: Optional[TreeNode]) -> bool:\n        \n        def dfs(left,right):\n            if not left and not right:\n                return True\n            if not left or not right: \n                return False\n            \n            return left.val==right.val and dfs(left.left,right.right) and dfs(left.right,right.left)\n        return dfs(root.left,root.right)\n```
['Python', 'Python3']