Description
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).
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).
Example:
1 | Input: |
Solution
1 | public int numberOfBoomerangs(int[][] points) { |
This solution is provided by asurana28 in discussion area
1 | Time complexity: O(n^2) |