We are given a list of (axis-aligned)
rectangle[i] = [xi1, yi1, xi2, yi2] , where
(xi1, yi1) are the coordinates of the bottom-left corner, and
(xi2, yi2) are the coordinates of the top-right corner of the
Find the total area covered by all
rectangles in the plane. Since the answer may be too large, return it modulo
109 + 7.
Input: rectangles = [[0,0,2,2],[1,0,2,3],[1,0,3,1]] Output: 6 Explanation: As illustrated in the picture.
Input: rectangles = [[0,0,1000000000,1000000000]] Output: 49 Explanation: The answer is 1018 modulo (109 + 7), which is (109)2 = (-7)2 = 49.
1 <= rectangles.length <= 200
rectanges[i].length = 4
0 <= rectangles[i][j] <= 109
263 - 1and thus will fit in a 64-bit signed integer.