[C++ ] Short Easy Recursive Solution Beats 100% of submissions!
\n#define l left\n#define r right\n#define null nullptr\nclass Solution {\npublic:\n    int f = 1;\n    void help(TreeNode* root1, TreeNode* root2){\n        if
```\n#define l left\n#define r right\n#define null nullptr\nclass Solution {\npublic:\n    int f = 1;\n    void help(TreeNode* root1, TreeNode* root2){\n        if(root1==null || root2==null) return ; \n        if( ((root1->l!=null && root2->l!=null && root1->l->val==root2->l->val) || (root1->l==root2->l)) && ((root1->r!=null && root2->r!=null && root1->r->val==root2->r->val) || (root1->r==root2->r))){\n            help(root1->l,root2->l);\n            help(root1->r,root2->r);\n        }else if (((root1->l!=null && root2->r!=null && root1->l->val==root2->r->val) || (root1->l==root2->r)) && ((root1->r!=null && root2->l!=null && root1->r->val==root2->l->val) || (root1->r==root2->l)) ){\n            help(root1->l,root2->r);\n            help(root1->r,root2->l);            \n        }else{\n            f=f&&0;\n        }\n    \n    }\n    bool flipEquiv(TreeNode* root1, TreeNode* root2) {\n        if((root1!=null && root2!=null && root1->val!=root2->val)||((root1==null||root2==null) &&root1!=root2)) return 0;\n        help(root1,root2);\n        return f;\n    }\n};\n```
['Depth-First Search', 'Recursion', 'C', 'C++']