1// Rectangle Overlap2// https://leetcode.com/problems/rectangle-overlap/34class Solution {5public boolean isRectangleOverlap(int[] rec1, int[] rec2) {6int x1 = rec1[0];7int y1 = rec1[1];8int x2 = rec1[2];9int y2 = rec1[3];10int x3 = rec2[0];11int y3 = rec2[1];12int x4 = rec2[2];13int y4 = rec2[3];14if (x1 >= x4 || x2 <= x3 || y1 >= y4 || y2 <= y3) {15return false;16}17return true;18}19}