classSolution: defminAreaRect(self, points): result = 0 stat = set(map(tuple, points))
for x1, y1 in points: for x2, y2 in points: if x1 == x2 or y1 == y2: continue if (x1, y2) in stat and (x2, y1) in stat: area = abs(x2 - x1) * abs(y2 - y1) if area < result or result == 0: result = area return result