Marks :10
: 10 | : 0
You are given a list of bombs. The range of a bomb is defined as the area where its effect can be felt. This area is in the shape of a circle with the center as the location of the bomb.
The bombs are represented by a $$$0$$$-indexed $$$2D$$$ integer array bombs where $$$bombs[i] = [x_{i}, y_{i}, r_{i}]$$$. $$$x_{i}$$$ and $$$y_{i}$$$ denote the $$$X$$$-coordinate and $$$Y$$$-coordinate of the location of the $$$i_{th}$$$ bomb, whereas $$$r_{i}$$$ denotes the radius of its range.
You may choose to detonate a single bomb. When a bomb is detonated, it will detonate all bombs that lie in its range. These bombs will further detonate the bombs that lie in their ranges.
Given the list of bombs, return the maximum number of bombs that can be detonated if you are allowed to detonate only one bomb.
The first line contains an integer $$$n$$$ denoting the number of bombs. The next $$$n$$$ line contains $$$3$$$ integer each $$$x_{i}$$$, $$$y_{i}$$$, $$$r_{i}$$$.$$$(1 \le n \le 100)$$$$$$(1 \le x_{i}, y_{i}, r_{i} \le 10^5).$$$
2 1 1 5 10 10 5
1
5 1 2 3 2 3 1 3 4 2 4 5 3 5 6 4
5
7 92387 35422 4898 32532 92988 4636 99872 57831 1700 47597 79017 5316 96560 4822 1820 62125 8873 1377 38988 12468 1596
1
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.