Detonate the Maximum Bombs
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
You are given bombs, where bombs[i] = [x, y, r] places a bomb at (x, y) with blast radius r. When a bomb explodes, every bomb whose center lies within or exactly on its circle (Euclidean distance <= r) also explodes, which can set off further bombs in turn.
Note that the relationship is **one-directional**: bomb A reaching B does not mean B reaches A.
You may manually detonate exactly one bomb. Return the maximum number of bombs that end up exploding (including the one you detonate). Compare squared distances with integers to avoid precision issues.
Examples
Constraints
- 1 <= bombs.length <= 100
- 1 <= x, y, r <= 10^5
- Squared distances can exceed 32-bit range; use 64-bit arithmetic
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.