← Questions

Count clusters of 2D points within a radius

0
GoogleCodingLast asked Jul 2026

Two points belong to the same cluster when they are within a given distance of each other, and clusters chain through shared neighbors. Given the points and the distance, count the clusters. Discuss how to find neighbors faster than comparing every pair.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding