n plants; plants[i] = [x, y] gives the position of plant i. A sprinkler waters a circle of radius radius centered where it is placed, and the center can be any point of the plane, not necessarily one with integer coordinates.
A plant counts as watered if it lies inside the circle or on its edge.
Return the largest number of plants a single sprinkler can water.plants=[[0, 0], [4, 0], [2, 1], [10, 10]], radius=2 → 3
A sprinkler at (2, 0) reaches (0, 0) and (4, 0), which sit exactly on the edge, and (2, 1). The plant at (10, 10) is out of reach.
plants=[[1, 1], [5, 5]], radius=1 → 1
The plants are more than two radii apart, so they cannot both be watered.
plants=[[0, 0], [4, 0], [2, 1], [10, 10]], radius=2
3
Run checks the first 3 tests in your browser. Submit checks all 128 tests on the server, hidden ones included.