Minimum Area Rectangle

Try to solve the Minimum Area Rectangle problem.

Statement

You are given an array of points, where point[i] =[xi,yi]= [x_i, y_i] represents a point on a 2D plane.

Your task is to determine the minimum area of a rectangle that can be formed using any four points where the rectangle’s sides are aligned parallel to the X and Y axes. If no such rectangle can be formed, return 00.

Constraints:

  • 11 \leq points.length 500\leq 500

  • points[i].length ==2== 2

  • 00 \leq xi ,, yi 103\leq 10^3

  • All given points are unique.

Examples

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.