[Python] Recursion - Clean & Concise
python\nclass Solution:\n    def flipEquiv(self, root1: Optional[TreeNode], root2: Optional[TreeNode]) -> bool:\n        if root1 == None and root2 == None: ret
```python\nclass Solution:\n    def flipEquiv(self, root1: Optional[TreeNode], root2: Optional[TreeNode]) -> bool:\n        if root1 == None and root2 == None: return True\n        if root1 == None or root2 == None or root1.val != root2.val: return False\n        if self.flipEquiv(root1.left, root2.right) and self.flipEquiv(root1.right, root2.left): return True\n        if self.flipEquiv(root1.left, root2.left) and self.flipEquiv(root1.right, root2.right): return True\n        return False\n```\nComplexity:\n- Time: `O(min(N1, N2))`, where `N1` is number of nodes in the binary tree `root1`, `N2` is number of nodes in the binary tree `root2`.\n- Space: `O(min(H1, H2))`, where `H1` is the height of binary tree `root1`, `H2` is the height of binary tree `root2`.
[]