You are given an array of points in the X-Y plane points where
points[i] = [xi, yi].
Return the minimum area of any rectangle formed from these points, with sidesnot necessarily parallel to the X and Y axes. If there is not any such rectangle, return 0.
Answers within 10-5 of the actual answer will be accepted.

Input: points =[[1,2],[2,1],[1,0],[0,1]]Output: 2.00000Explanation: The minimum area rectangle occurs at [1,2],[2,1],[1,0],[0,1],with an area of 2.

Input: points =[[0,1],[2,1],[1,1],[1,0],[2,0]]Output: 1.00000Explanation: The minimum area rectangle occurs at [1,0],[1,1],[2,1],[2,0],with an area of 1.

Input: points =[[0,3],[1,2],[3,1],[1,3],[2,1]]Output: 0Explanation: There is no possible rectangle to form from these points.
To find the minimum area rectangle (not necessarily axis-aligned), we need to check all quadruples of points that can form a rectangle. For any two points, if their midpoint and distance are the same as another pair, they can be diagonally opposite corners of a rectangle. We use a hash map to group pairs by their midpoint and distance, then check for rectangles.
defmin_area_free_rect(points: list[list[int]]) -> float:
from collections import defaultdict
import math
n = len(points)
mp = defaultdict(list)
for i in range(n):
for j in range(i+1, n):
x1, y1 = points[i]
x2, y2 = points[j]
mid = ((x1 + x2) /2, (y1 + y2) /2)
dist = (x1 - x2) **2+ (y1 - y2) **2 mp[(mid, dist)].append((i, j))
ans = float('inf')
for pairs in mp.values():
for a in range(len(pairs)):
for b in range(a+1, len(pairs)):
i1, j1 = pairs[a]
i2, j2 = pairs[b]
p1, p2, p3 = points[i1], points[j1], points[i2]
d1 = math.hypot(p1[0] - p3[0], p1[1] - p3[1])
d2 = math.hypot(p2[0] - p3[0], p2[1] - p3[1])
area = d1 * d2
if area < ans and area >1e-8:
ans = area
return0if ans == float('inf') else ans