Python 1-liner
The solution uses library function choice from package random.\n\nFinal version after refactoring:\n\nclass Solution:\n    def __init__(self, rects: List[List[i
The solution uses library function choice from package random.\n\nFinal version after refactoring:\n```\nclass Solution:\n    def __init__(self, rects: List[List[int]]):\n        self.r=[*zip(*[[r,(r[2]-r[0]+1)*(r[3]-r[1]+1)]for r in rects])]\n    def pick(self) -> List[int]:\n        return [[randint(r[0],r[2]), randint(r[1],r[3])] for r in choices(*self.r)][0]\n``` \n\nPrevious version:\n```\nclass Solution:\n    def __init__(self, rects: List[List[int]]):\n        self.r=[*zip(*reduce(lambda a,r:a+[[[(r[0],r[2]),(r[1],r[3])],(r[2]-r[0]+1)*(r[3]-r[1]+1)]],rects,[]))]\n    def pick(self) -> List[int]:\n        return [[randint(*x), randint(*y)] for x,y in choices(*self.r)][0]\n```\n\nVersion before previous with 2 variables for rectangles and weights:\n```\nclass Solution:\n    def __init__(self, rects: List[List[int]]):\n        self.r,self.w=zip(*reduce(lambda a,r:a+[[[(r[0],r[2]),(r[1],r[3])],(r[2]-r[0]+1)*(r[3]-r[1]+1)]],rects,[]))\n \n    def pick(self) -> List[int]:\n        return [[randint(*x), randint(*y)] for x,y in choices(self.r, self.w)][0]\n```\n
[]