You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/com/fishercoder/solutions/_447.java
+45-49Lines changed: 45 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,15 @@
3
3
importjava.util.HashMap;
4
4
importjava.util.Map;
5
5
6
-
/**Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k (the order of the tuple matters).
7
-
8
-
Find the number of boomerangs. You may assume that n will be at most 500 and coordinates of points are all in the range [-10000, 10000] (inclusive).
6
+
/**
7
+
* 447. Number of Boomerangs
8
+
*
9
+
* Given n points in the plane that are all pairwise distinct,
10
+
* a "boomerang" is a tuple of points (i, j, k) such that the distance
11
+
* between i and j equals the distance between i and k (the order of the tuple matters).
12
+
*
13
+
* Find the number of boomerangs.
14
+
* You may assume that n will be at most 500 and coordinates of points are all in the range [-10000, 10000] (inclusive).
9
15
10
16
Example:
11
17
Input:
@@ -17,57 +23,47 @@
17
23
Explanation:
18
24
The two boomerangs are [[1,0],[0,0],[2,0]] and [[1,0],[2,0],[0,0]]*/
19
25
publicclass_447 {
20
-
/**Looked at these two posts: https://discuss.leetcode.com/topic/66587/clean-java-solution-o-n-2-166ms and
0 commit comments