Tap here to switch tabs
Problem
Submissions

Problem: Count Lattice Points Inside a Circle

med
30 min
Try to solve the Count Lattice Points Inside a Circle problem.

Statement

Given a 22D integer array circles where circles[i] = [x_i, y_i, r_i] represents the center (x_i, y_i) and radius r_i of the iextthi^{ ext{th}} circle, return the number of unique lattice points that lie inside or on the boundary of at least one circle.

Note: A lattice point is a point with integer coordinates. A point is considered inside a circle if the distance from the point to the center of the circle is less than or equal to the radius of the circle.

Constraints:

  • 1≤1 \leq circles.length ≤200\leq 200

  • circles[i].length =3= 3

  • 1≤1 \leq x_i, y_i ≤100\leq 100

  • 1≤1 \leq r_i ≤min⁡(\leq \min(x_i, y_i))

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Lattice Points Inside a Circle

med
30 min
Try to solve the Count Lattice Points Inside a Circle problem.

Statement

Given a 22D integer array circles where circles[i] = [x_i, y_i, r_i] represents the center (x_i, y_i) and radius r_i of the iextthi^{ ext{th}} circle, return the number of unique lattice points that lie inside or on the boundary of at least one circle.

Note: A lattice point is a point with integer coordinates. A point is considered inside a circle if the distance from the point to the center of the circle is less than or equal to the radius of the circle.

Constraints:

  • 1≤1 \leq circles.length ≤200\leq 200

  • circles[i].length =3= 3

  • 1≤1 \leq x_i, y_i ≤100\leq 100

  • 1≤1 \leq r_i ≤min⁡(\leq \min(x_i, y_i))