3047. Find the Largest Area of Square Inside Two Rectangles
There exist
n
rectangles in a 2D plane. You are given two 0-indexed 2D integer arraysbottomLeft
andtopRight
, both of sizen x 2
, wherebottomLeft[i]
andtopRight[i]
represent the bottom-left and top-right coordinates of theith
rectangle respectively.You can select a region formed from the intersection of two of the given rectangles. You need to find the largest area of a square that can fit inside this region if you select the region optimally.
Return the largest possible area of a square, or
0
if there do not exist any intersecting regions between the rectangles.
c++
1 |
|