Skip to content

Instantly share code, notes, and snippets.

@Shogun89
Created June 18, 2022 17:58
Show Gist options
  • Save Shogun89/d7e69c284e5272b956ec52f3a4123cce to your computer and use it in GitHub Desktop.
Save Shogun89/d7e69c284e5272b956ec52f3a4123cce to your computer and use it in GitHub Desktop.
class Solution:
def countPoints(self, points: List[List[int]], queries: List[List[int]]) -> List[int]:
output = []
def point_distance(circ, point):
dist = ((circ[0] - point[0])**2 + (circ[1] - point[1])**2 )**(1/2)
return dist
for circ in queries:
count = 0
radius = circ[2]
for point in points:
dist = point_distance(circ, point)
if dist <= radius:
count +=1
output.append(count)
return output
@Shogun89
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment