100% beat  wrt tc
Intuition\n Describe your first thoughts on how to solve this problem. \nDFS\n\n# Approach\n Describe your approach to solving the problem. \ncheck if left of b
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nDFS\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\ncheck if left of both is same then right should be same \nother wise swap .\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(N)\n\n# Code\n```cpp []\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(0), left(nullptr), right(nullptr) {}\n *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}\n *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}\n * };\n */\n //lecture:\nclass Solution {\npublic:\n    bool flipEquiv(TreeNode* root1, TreeNode* root2) {\n        if(root1==NULL and root2==NULL) return true;\n        if(root1==NULL || root2==NULL) return false;\n        if(root1->val!=root2->val) return false;\n           bool info= flipEquiv(root1->left,root2->left) && flipEquiv(root1->right,root2->right);\n           if(info) return true;\n        return   flipEquiv(root1->left,root2->right) && flipEquiv(root1->right,root2->left);\n \n    }\n};\n```
['C++']