Find the total area covered by two rectilinear rectangles in a 2D plane.
Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.
Rectangle Area
Assume that the total area is never beyond the maximum possible value of int.
Credits: Special thanks to @mithmatt for adding this PRoblem, creating the above image and all test cases.
Subscribe to see which companies asked this question.
要計算的面積是兩者各自的面積減去覆蓋的面積
新聞熱點
疑難解答