# Leetcode 447 - Number of Boomerangs

Note:

• 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 j and k. Assume the length is l, how many combinations can we come up with? It’s l * (l - 1)!

Question:

You are given n 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 i and j equals the distance between i and k (the order of the tuple matters).

Return the number of boomerangs.

Example:

Code: