Python easy to understand recursive solution
\nclass Solution(object):\n    def flipEquiv(self, root1, root2):\n        if not root1 or not root2:\n            return root1 == root2\n        return root1.v
```\nclass Solution(object):\n    def flipEquiv(self, root1, root2):\n        if not root1 or not root2:\n            return root1 == root2\n        return root1.val == root2.val and ((self.flipEquiv(root1.left, root2.right) and self.flipEquiv(root1.right, root2.left)) or (self.flipEquiv(root1.left, root2.left) and self.flipEquiv(root1.right, root2.right)))\n```
[]