3
1 <= rects.length <= 1005
-10^9 <= ai < xi <= 10^96
-10^9 <= bi < yi <= 10^99
All the rectangles do not overlap.10
At most 10^4 calls will be made to pick.13
def __init__(self, rects: List[List[int]]):15
self.n_range = list(range(len(self.rects)))16
self.weights = [(x[2] - x[0] + 1) * (x[3] - x[1] + 1) for x in rects]18
def pick(self) -> List[int]:19
rect = self.rects[choices(self.n_range, self.weights, k=1)[0]]20
return [randint(rect[0], rect[2]), randint(rect[1], rect[3])]23
# Your Solution object will be instantiated and called as such:24
# obj = Solution(rects)