Can anyone please point out what the issue is?

```
func numberOfBoomerangs(_ points: [[Int]]) -> Int {
if points.count == 0 {
return 0
}
var dictionary = [Int: Int]()
var res = 0
for p in points {
for q in points {
let x = p[0] - q[0]
let y = p[1] - q[1]
let distance = x * x + y * y
dictionary[distance] = (dictionary[distance] ?? 0 ) + 1
res += 2 * (dictionary[distance]! - 1)
}
dictionary.removeAll()
}
return res
}
```