Java One Line with explanation
Just from experience with these types of problems, it\'s usually easier to find out the opposite of what doesn\'t overlap.  The following cases they don\'t over
Just from experience with these types of problems, it\'s usually easier to find out the opposite of what doesn\'t overlap.  The following cases they don\'t overlap:\nCase 1:if the maximum of rec1 is less than or equal to the minimum from rec2 in the x\nCase 2:if the maximum of rec1 is less than or equal to the minimum from rec2 in the y\nCase 3: just swap rec1 and rec2 in Case 1\nCase 4:Just swap rec1 and rec2 in Case 2\nAll other cases they overlap.\n```\nclass Solution {\n    public boolean isRectangleOverlap(int[] rec1, int[] rec2) {\n        return(!(rec1[2]<=rec2[0]||rec1[3]<=rec2[1]||rec2[2]<=rec1[0]||rec2[3]<=rec1[1]));\n    }\n}\n```
[]