100% beat c++
\nbool flipEquiv(TreeNode* root1, TreeNode* root2) {\n        if (root1 == NULL && root2 == NULL) return true;\n        if ((root1 == NULL && root2) || (root2 =
```\nbool flipEquiv(TreeNode* root1, TreeNode* root2) {\n        if (root1 == NULL && root2 == NULL) return true;\n        if ((root1 == NULL && root2) || (root2 == NULL && root1)) return false;\n        if (root1->val != root2->val) return false;\n        return (flipEquiv(root1->leftLeaf, root2->leftLeaf) && flipEquiv(root1->rightLeaf, root2->rightLeaf)) || \\\n            (flipEquiv(root1->leftLeaf, root2->rightLeaf) && flipEquiv(root1->rightLeaf, root2->leftLeaf));\n    }\n```\n
[]