The Detonate the Maximum Bombs coding problem gives you a list of bombs on a 2D plane. Each bomb is represented as , where is its blast radius. If one bomb detonates and another bomb is within its radius, the second bomb also detonates. You want to find the maximum number of bombs that can be detonated if you start by triggering exactly one bomb.
Uber and Microsoft ask this to test your ability to model a geometric problem as a graph. It’s a "Connectivity" problem. Even though it involves distances, the relationship between bombs is directed (Bomb A can reach B, but B might not reach A). It evaluations your proficiency with BFS or DFS and your understanding of the distance formula.
This problem uses Graph Construction and Graph Traversal (DFS/BFS).
Bomb 1: (0,0,5), Bomb 2: (3,0,1).
When building graphs from coordinates, always consider the density. Since is usually small () in this problem, an graph construction is perfectly fine.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Check if the Rectangle Corner Is Reachable | Hard | Solve | |
| Most Profitable Path in a Tree | Medium | Solve | |
| Maximize Amount After Two Days of Conversions | Medium | Solve | |
| Shortest Distance After Road Addition Queries I | Medium | Solve | |
| Water and Jug Problem | Medium | Solve |