mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
39 lines
1.4 KiB
HTML
39 lines
1.4 KiB
HTML
<p>给定平面上<em> </em><code>n</code><em> </em>对 <strong>互不相同</strong> 的点 <code>points</code> ,其中 <code>points[i] = [x<sub>i</sub>, y<sub>i</sub>]</code> 。<strong>回旋镖</strong> 是由点 <code>(i, j, k)</code> 表示的元组 ,其中 <code>i</code> 和 <code>j</code> 之间的欧式距离和 <code>i</code> 和 <code>k</code> 之间的欧式距离相等(<strong>需要考虑元组的顺序</strong>)。</p>
|
||
|
||
<p>返回平面上所有回旋镖的数量。</p>
|
||
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>points = [[0,0],[1,0],[2,0]]
|
||
<strong>输出:</strong>2
|
||
<strong>解释:</strong>两个回旋镖为 <strong>[[1,0],[0,0],[2,0]]</strong> 和 <strong>[[1,0],[2,0],[0,0]]</strong>
|
||
</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>points = [[1,1],[2,2],[3,3]]
|
||
<strong>输出:</strong>2
|
||
</pre>
|
||
|
||
<p><strong>示例 3:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>points = [[1,1]]
|
||
<strong>输出:</strong>0
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>n == points.length</code></li>
|
||
<li><code>1 <= n <= 500</code></li>
|
||
<li><code>points[i].length == 2</code></li>
|
||
<li><code>-10<sup>4</sup> <= x<sub>i</sub>, y<sub>i</sub> <= 10<sup>4</sup></code></li>
|
||
<li>所有点都 <strong>互不相同</strong></li>
|
||
</ul>
|