cpp
\nclass Solution {\npublic:\n    bool isRectangleOverlap(vector<int>& rec1, vector<int>& rec2) {\n        //rec2 lies to the left of rec1. agr rec2 ka rightmost
```\nclass Solution {\npublic:\n    bool isRectangleOverlap(vector<int>& rec1, vector<int>& rec2) {\n        //rec2 lies to the left of rec1. agr rec2 ka rightmost x cordinate rec1 k left most x cordinate s kam h tabhi ye nischit h ki rec2 left mai hoga rec1 k. \n        if(rec2[2]<=rec1[0]) return false;\n        //rec2 lies to the right of rec1. agr rec2 ka leftmost x cordinate rec1 k right most x cordinate s jyada h tabhi ye nischit h ki rec2 right mai hoga rec1 k. \n        if(rec2[0]>=rec1[2]) return false;\n        //rec2 lies to the top of rec1. agr rec2 ka bottommost y cordinate rec1 k top most y cordinate s jyada h tabhi ye nischit h ki rec2 top mai hoga rec1 k. \n        if(rec2[1]>=rec1[3]) return false;\n        //rec2 lies to the bottom of rec1. agr rec2 ka topmost y cordinate rec1 k bottom most y cordinate s kam h tabhi ye nischit h ki rec2 niche mai hoga rec1 k. \n        if(rec2[3]<=rec1[1]) return false;\n        return true;\n    }\n};\n```
[]