C++ 4 Lines Solution
\nclass Solution {\npublic:\n    bool flipEquiv(TreeNode* root1, TreeNode* root2) {\n        if(!root1 and !root2) return true;\n        if((!root1 and root2) o
```\nclass Solution {\npublic:\n    bool flipEquiv(TreeNode* root1, TreeNode* root2) {\n        if(!root1 and !root2) return true;\n        if((!root1 and root2) or (!root2 and root1)) return false;\n        if(root1->val != root2->val) return false;\n        return (flipEquiv(root1->left,root2->right) and flipEquiv(root1->right,root2->left)) or (flipEquiv(root1->left,root2->left) and flipEquiv(root1->right,root2->right));\n    }\n};\n```
['C']