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.
要计算的面积是两者各自的面积减去覆盖的面积
新闻热点
疑难解答