Python weighted probability solution
\nclass Solution:\n\n    def __init__(self, rects):\n        self.rects, self.ranges, sm = rects, [], 0\n        for x1, y1, x2, y2 in rects:\n            sm +=
```\nclass Solution:\n\n    def __init__(self, rects):\n        self.rects, self.ranges, sm = rects, [], 0\n        for x1, y1, x2, y2 in rects:\n            sm += (x2 - x1 + 1) * (y2 - y1 + 1)\n            self.ranges.append(sm)\n\n    def pick(self):\n        x1, y1, x2, y2 = self.rects[bisect.bisect_left(self.ranges, random.randint(1, self.ranges[-1]))]\n        return [random.randint(x1, x2), random.randint(y1, y2)]\n```
[]