Skip to content

Commit 1b620ae

Browse files
Create README - LeetHub
1 parent 33b435b commit 1b620ae

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

number-of-boomerangs/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<h2>447. Number of Boomerangs</h2><h3>Medium</h3><hr><div><p>You are given <code>n</code> <code>points</code> in the plane that are all <strong>distinct</strong>, where <code>points[i] = [x<sub>i</sub>, y<sub>i</sub>]</code>. A <strong>boomerang</strong> is a tuple of points <code>(i, j, k)</code> such that the distance between <code>i</code> and <code>j</code> equals the distance between <code>i</code> and <code>k</code> <strong>(the order of the tuple matters)</strong>.</p>
2+
3+
<p>Return <em>the number of boomerangs</em>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong>Example 1:</strong></p>
7+
8+
<pre><strong>Input:</strong> points = [[0,0],[1,0],[2,0]]
9+
<strong>Output:</strong> 2
10+
<strong>Explanation:</strong> The two boomerangs are [[1,0],[0,0],[2,0]] and [[1,0],[2,0],[0,0]].
11+
</pre>
12+
13+
<p><strong>Example 2:</strong></p>
14+
15+
<pre><strong>Input:</strong> points = [[1,1],[2,2],[3,3]]
16+
<strong>Output:</strong> 2
17+
</pre>
18+
19+
<p><strong>Example 3:</strong></p>
20+
21+
<pre><strong>Input:</strong> points = [[1,1]]
22+
<strong>Output:</strong> 0
23+
</pre>
24+
25+
<p>&nbsp;</p>
26+
<p><strong>Constraints:</strong></p>
27+
28+
<ul>
29+
<li><code>n == points.length</code></li>
30+
<li><code>1 &lt;= n &lt;= 500</code></li>
31+
<li><code>points[i].length == 2</code></li>
32+
<li><code>-10<sup>4</sup> &lt;= x<sub>i</sub>, y<sub>i</sub> &lt;= 10<sup>4</sup></code></li>
33+
<li>All the points are <strong>unique</strong>.</li>
34+
</ul>
35+
</div>

0 commit comments

Comments
 (0)