LeetCode 447, Medium. Topics: Array, Hash Table, Math. View on LeetCode.
Generate this problem as a practice environment: tested reference solution, 24 parametrized pytest cases, and a playground notebook:
Problem
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).
Examples
Constraints
- 1 <= n <= 500
- points[i].length == 2
- -10^4 <= xi, yi <= 10^4
- All the points are unique.
Solution
Reference implementation from solution.py on GitHub, full suite in test_solution.py:
Complexity
Last modified on September 7, 2026