charges[i] = [x, y, r] sits at point (x, y), and its burst ignites everything inside the circle of radius r around that point, boundary included.
When a charge goes off, it ignites every charge within its circle, those ignite the charges within theirs, and so on. Note that A reaching B does not mean B reaches A.
You light exactly one charge. Return the largest number of charges that can end up going off, the first one included.charges=[[2, 2, 5], [6, 2, 3], [9, 2, 3]] → 3
Charge 0 reaches charge 1 (distance 4), which in turn reaches charge 2 (distance 3), so all three go off. Starting from charge 2 only sets off charge 1, whose radius falls short of charge 0.
charges=[[1, 1, 1], [10, 10, 1]] → 1
The charges are too far apart, so only the one you light goes off.
charges=[[2, 2, 5], [6, 2, 3], [9, 2, 3]]
3
Run checks the first 3 tests in your browser. Submit checks all 117 tests on the server, hidden ones included.