LeetCode 223 Rectangle Area in Java

In this post we will solve LeetCode 223 Rectangle Area in Java.

Given the coordinates of two rectilinear rectangles in a 2D plane, 
return the total area covered by the two rectangles.

The first rectangle is defined by its bottom-left corner (ax1, ay1) and its top-right corner (ax2, ay2).

The second rectangle is defined by its bottom-left corner (bx1, by1) and its top-right corner (bx2, by2).

Constraints:

o -10^4 <= ax1, ay1, ax2, ay2, bx1, by1, bx2, by2 <= 10^4

Related Topics:

o Math
o Geometry

We are given the coordinates of two rectilinear rectangles in a 2D plane and are asked to return the total area covered by the two rectangles. Continue reading “LeetCode 223 Rectangle Area in Java”