You are given a list of distinct points on a 2D plane. A boomerang is defined as an ordered triplet of points (i, j, k) such that the distance between point i and point j is the same as the distance between point i and point k.
Note that order matters, meaning (i, j, k) and (i, k, j) are considered different.
Return the total number of such boomerang triplets.
Input: points = [[0,0],[0,2],[2,0],[2,2]]
Output: 8
Explanation:
Several combinations around each center have equal distances.
Input: points = [[0,0],[1,1],[1,0],[0,1]]
Output: 8
Explanation:
Each point forms symmetric distances with its neighbors.
Input: points = [[2,3]]
Output: 0
Explanation:
Only one point → No possible triplets.
Accepted:
Submission: