0939. Minimum Area Rectangle

https://leetcode.com/problems/minimum-area-rectangle

Description

You are given an array of points in the X-Y plane points where points[i] = [xi, yi].

Return the minimum area of a rectangle formed from these points, with sides parallel to the X and Y axes. If there is not any such rectangle, return 0.

Example 1:

Example 2:

Constraints:

  • 1 <= points.length <= 500

  • points[i].length == 2

  • 0 <= xi, yi <= 4 * 104

  • All the given points are unique.

ac

Last updated

Was this helpful?