Easy to understand Python 3 Solution
The crux of the problem is understanding that the solution is also evaluated on the kind of random distribution your solution offers. A random distribution, uni
The crux of the problem is understanding that the solution is also evaluated on the kind of random distribution your solution offers. A random distribution, uniform over the areas of the rectangles is expected. \n\nUses Python3\'s random.choices() function that allows weighted sampling from a specified population. The important thing to note here is that while calculaating the areas, we compute area as:  (x2 - x1 + 1) x (y2 - y1 +1) instead of the (x2 - x1) x (y2 - y1 ). \nThis is because a rectaangle of area 1 corresponds to 4 integer points, not just one integer point.\n\n```\nclass Solution:\n\n    def __init__(self, rects):\n        """\n        :type rects: List[List[int]]\n        """\n        self.rects = rects\n        \n        self.areas = []\n        for _ in range(len(rects)):\n            self.areas.append((rects[_][2] - rects[_][0] + 1)*(rects[_][3] - rects[_][1] + 1))\n        \n    def pick(self):\n        """\n        :rtype: List[int]\n        """\n        temp = [i for i in range(len(self.rects))]\n        rect = random.choices(population = temp, weights = self.areas)[0]\n                \n        x_min = self.rects[rect][0]\n        x_max = self.rects[rect][2]\n        \n        y_min = self.rects[rect][1]\n        y_max = self.rects[rect][3]\n        \n        p_x = random.randint(x_min, x_max)\n        p_y = random.randint(y_min, y_max)\n        \n        return[p_x, p_y]\n```\n\n\nSame solution but shortened (minor improvements)\n\n```\nclass Solution:\n\n    def __init__(self, rects):\n        """\n        :type rects: List[List[int]]\n        """\n        self.rects = rects\n        self.areas = [(rects[_][2] - rects[_][0] + 1)*(rects[_][3] - rects[_][1] + 1) for _ in range(len(rects))]\n        \n        \n    def pick(self):\n        """\n        :rtype: List[int]\n        """\n        rect = random.choices(population = range(len(self.rects)), weights = self.areas)[0]\n        return[random.randint(self.rects[rect][0], self.rects[rect][2]), random.randint(self.rects[rect][1], self.rects[rect][3])]\n\n```\n
[]