- Not a really good problem.
- For every
point, build a map with
key = dist, val = point coords(val should be an array).
- Math knowledge: For each pair, its val contains our
k. Assume the
l, how many
combinationscan we come up with? It’s
l * (l - 1)!
You are given
points in the plane that are all distinct, where
points[i] = [xi, yi]. A boomerang is a tuple of points
(i, j, k) such that the distance between
j equals the distance between
k (the order of the tuple matters).
number of boomerangs.
Input: points = [[0,0],[1,0],[2,0]]