Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 428 Bytes

1828.md

File metadata and controls

14 lines (12 loc) · 428 Bytes

1828. Queries on Number of Points Inside a Circle

Solution 1 (time O(mn), space O(1))

class Solution(object):
    def countPoints(self, points, queries):
        """
        :type points: List[List[int]]
        :type queries: List[List[int]]
        :rtype: List[int]
        """
        return [sum((px - qx) ** 2 + (py - qy) ** 2 <= qr ** 2 for px, py in points) for qx, qy, qr in queries]