Skip to content

Latest commit

 

History

History
91 lines (37 loc) · 1.19 KB

File metadata and controls

91 lines (37 loc) · 1.19 KB

Description

Given a set of points in the xy-plane, determine the minimum area of a rectangle formed from these points, with sides parallel to the x and y axes.

If there isn't any rectangle, return 0.

 

Example 1:

Input: [[1,1],[1,3],[3,1],[3,3],[2,2]]

Output: 4

Example 2:

Input: [[1,1],[1,3],[3,1],[3,3],[4,1],[4,3]]

Output: 2

 

Note:

    <li><code>1 &lt;= points.length &lt;= 500</code></li>
    
    <li><code>0 &lt;=&nbsp;points[i][0] &lt;=&nbsp;40000</code></li>
    
    <li><code>0 &lt;=&nbsp;points[i][1] &lt;=&nbsp;40000</code></li>
    
    <li>All points are distinct.</li>
    

Solutions

Python3

Java

...