Easy-2-Understand || Think-Outside-The-Box || C++ || Intuition Explained
Lets consider the scenarios where the rectangle do not overlap, and think what the other cases will lead to the conditions in which they overlap.\nCheck for the
Lets ***consider the scenarios where the rectangle do not overlap***, and think what the ***other cases will lead to the conditions in which they overlap***.\nCheck for the ***condition of non-overlap of rectangles*** and ***get its negation***. If its negation is true that mean there is a overlap otherwise they don\'t overlap.\n\n![image](https://assets.leetcode.com/users/images/489c284b-d750-43ec-a612-e5436a298b42_1644864655.2305791.jpeg)\n\n\n\n```\nclass Solution {\npublic:\n    bool isRectangleOverlap(vector<int>& rec1, vector<int>& rec2) {\n        int a1=rec1[0],b1=rec1[1],a2=rec1[2],b2=rec1[3];\n        int x1=rec2[0],y1=rec2[1],x2=rec2[2],y2=rec2[3];\n\n        if(!(x2<=a1 || y1>=b2 || x1>=a2 || b1>=y2))\n            return true;\n        \n        return false;\n    }\n};\n```\n\n**PS**: If it was helpfull please do **upvote!**, if any *query or suggestion* drop a comment.
[]