⠀lovely_anna
 # Intuition  \n\n\n\n\n\n\n\n\n\n\n\n\n# Code\nJS []\nvar flipEquiv = function (a, b) {\n    let ans\n    if (a === null && b === null)\n        ans = true\n  
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n<!-- # Approach -->\n<!-- Describe your approach to solving the problem. -->\n\n<!-- # Complexity -->\n<!-- - Time complexity: -->\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n<!-- - Space complexity: -->\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```JS []\nvar flipEquiv = function (a, b) {\n    let ans\n    if (a === null && b === null)\n        ans = true\n    else if (a === null || b === null)\n        ans = false\n    else if (a.val !== b.val)\n        ans = false\n    else\n        ans = (flipEquiv(a.left, b.left) && flipEquiv(a.right, b.right) ||\n               flipEquiv(a.left, b.right) && flipEquiv(a.right, b.left))\n    return ans\n}\n```
['JavaScript']