mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-13 17:35:14 +08:00
update
This commit is contained in:
@@ -1,28 +1,30 @@
|
||||
<p>给定在 xy 平面上的一组点,确定由这些点组成的矩形的最小面积,其中矩形的边平行于 x 轴和 y 轴。</p>
|
||||
<p>给你一个 <strong>X-Y </strong>平面上的点数组 <code>points</code>,其中 <code>points[i] = [x<sub>i</sub>, y<sub>i</sub>]</code>。</p>
|
||||
|
||||
<p>如果没有任何矩形,就返回 0。</p>
|
||||
<p>返回由这些点形成的矩形的最小面积,矩形的边与 X 轴和 Y 轴平行。如果不存在这样的矩形,则返回 <code>0</code>。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>[[1,1],[1,3],[3,1],[3,3],[2,2]]
|
||||
<strong>输出:</strong>4
|
||||
<p><strong class="example">示例 1:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/08/03/rec1.JPG" style="width: 500px; height: 447px;" />
|
||||
<pre>
|
||||
<strong>输入:</strong> points = [[1,1],[1,3],[3,1],[3,3],[2,2]]
|
||||
<strong>输出:</strong> 4
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>[[1,1],[1,3],[3,1],[3,3],[4,1],[4,3]]
|
||||
<strong>输出:</strong>2
|
||||
<p><strong class="example">示例 2:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/08/03/rec2.JPG" style="width: 500px; height: 477px;" />
|
||||
<pre>
|
||||
<strong>输入:</strong> points = [[1,1],[1,3],[3,1],[3,3],[4,1],[4,3]]
|
||||
<strong>输出:</strong> 2
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ol>
|
||||
<ul>
|
||||
<li><code>1 <= points.length <= 500</code></li>
|
||||
<li><code>0 <= points[i][0] <= 40000</code></li>
|
||||
<li><code>0 <= points[i][1] <= 40000</code></li>
|
||||
<li>所有的点都是不同的。</li>
|
||||
</ol>
|
||||
<li><code>points[i].length == 2</code></li>
|
||||
<li><code>0 <= x<sub>i</sub>, y<sub>i</sub> <= 4 * 10<sup>4</sup></code></li>
|
||||
<li>所有给定的点都是 <strong>唯一 </strong>的。</li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user