https://leetcode-cn.com/problems/queries-on-number-of-points-inside-a-circle/
class Solution { public int[] countPoints(int[][] points, int[][] queries) { int[] result = new int[queries.length]; for(int countPoints = 0;countPoints < points.length; countPoints++) { for(int countQueries = 0;countQueries < queries.length; countQueries++) { if(inCircle(points[countPoints], queries[countQueries])) { result[countQueries]++; } } } return result; } private boolean inCircle(int[] points,int[] queries) { int x = points[0]-queries[0]; int y = points[1]-queries[1]; double d = Math.sqrt(x * x + y * y); return d <= queries[2]; } }