Statement
An axis-aligned rectangle is represented by a listÂ
 denotes the coordinates of the bottom-left corner.  denotes the coordinates of the top-right corner.
The rectangle’s sides are aligned with the axes:
The top and bottom edges are parallel to the
. The left and right edges are parallel to the
.
Note: Two rectangles are considered to overlap if their intersection forms a region with a positive area. Rectangles that touch only at the edges or corners are not considered to overlap.
Determine if the two axis-aligned rectangles, rec1
and rec2
, overlap. Return TRUE if they overlap; otherwise, return FALSE.
Constraints:
rec1.length
rec2.length
rec1[i]
,rec2[i]
rec1
 andÂrec2
 represent a valid rectangle with a non-zero area.