Very simple solution. Math for area overlap. Beats 100% (With diagram)
Intuition\nFor there to be an area overlap, there needs to be both horizontal and vertical overlap.\n\n### Vertical overlap\n\n\n### Horizontal overlap\n\n\n\n#
# Intuition\nFor there to be an area overlap, there needs to be both horizontal and vertical overlap.\n\n### Vertical overlap\n![vertical.drawio.png](https://assets.leetcode.com/users/images/3367c15d-064d-4d03-8faf-d1b07e7fab23_1730790564.6113615.png)\n\n### Horizontal overlap\n![horizontal.drawio.png](https://assets.leetcode.com/users/images/f0401377-62eb-44fe-87c6-85be6880f415_1730790609.9785905.png)\n\n\n# Complexity\n- Time complexity:\n$$O(1)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```python3 []\nclass Solution:\n    def isRectangleOverlap(self, rec1: List[int], rec2: List[int]) -> bool:\n        horizontal = False\n        vertical = False\n        # rec2.x1 < rec1.x2 and rec2.x2 > rec1.x1\n        if rec2[0] < rec1[2] and rec2[2] > rec1[0]:\n            horizontal = True\n        # rec2.y1 < rec1.y2 and rec2.y2 > rec1.y1\n        if rec2[1] < rec1[3] and rec2[3] > rec1[1]:\n            vertical = True\n        return horizontal and vertical\n```\n```C++ []\nclass Solution {\npublic:\n    bool isRectangleOverlap(vector<int>& rec1, vector<int>& rec2) {\n        bool horizontal = false;\n        bool vertical = false;\n        // rec2.x1 < rec1.x2 and rec2.x2 > rec1.x1\n        if (rec2[0] < rec1[2] && rec2[2] > rec1[0])\n            horizontal = true;\n        // rec2.y1 < rec1.y2 and rec2.y2 > rec1.y1\n        if (rec2[1] < rec1[3] && rec2[3] > rec1[1])\n            vertical = true;\n        return horizontal && vertical;\n    }\n};\n```
['Math', 'Geometry', 'C++', 'Python3']