Each row of bombs is [x,y,r]: a bomb centered at coordinates (x,y) with blast radius r. You may initially detonate exactly one bomb. A detonated bomb triggers every other bomb whose center is inside or on the boundary of its blast circle. Each newly triggered bomb then uses its own radius to continue the chain reaction. Return the largest number of distinct bombs that can detonate, including the first bomb, over all choices of the initial bomb. A blast reaching another bomb is directional: the second bomb need not have enough range to trigger the first.
Example 1:
Input: bombs = [[1,1,2],[3,1,1]]
Output: 2Explanation: The centers are 2 units apart. Starting the first bomb reaches the second exactly on its radius boundary, so both detonate. The second bomb alone cannot reach the first.
Example 2:
Input: bombs = [[1,1,1],[4,1,1]]
Output: 1Explanation: The centers are 3 units apart and each radius is only 1. Neither bomb can trigger the other, so any choice detonates just one bomb.
Example 3:
Input: bombs = [[1,1,2],[3,1,2],[5,1,1]]
Output: 3Explanation: Start the bomb at (1,1). Its radius reaches the bomb at (3,1), whose own radius then reaches the bomb at (5,1). All three detonate even though the first blast does not directly reach the third bomb.
Constraints:
1 <= bombs.length <= 100- Every bomb is represented by exactly three integers
[x,y,r]. - Each coordinate and radius is between
1and100000, inclusive.