couldn't figure out a faster way so far.

```
class Solution(object):
def numberOfBoomerangs(self, points):
"""
:type points: List[List[int]]
:rtype: int
"""
if len(points) < 3:
return 0
res = 0
for i in range(len(points)):
pDict = {}
for j in range(len(points)):
if j == i:
continue
dis = pow(points[i][0] - points[j][0], 2) + pow(points[i][1] - points[j][1], 2)
key = str(dis)
if key in pDict:
pDict[key] += 1
else:
pDict[key] = 1
for p in pDict:
if pDict[p] > 1:
res += pDict[p] * (pDict[p] - 1)
return res
```