Detonate Bombs with Chain Reactions
Updated
Problem statement
Each entry bombs[i] = [x, y, radius] describes a bomb centered at (x, y). When bomb i detonates, it immediately detonates every still-undetonated bomb whose center is at Euclidean distance at most radius from (x, y). Those bombs can trigger further detonations.
You may choose exactly one bomb to detonate first. Return the maximum number of bombs that can detonate in the resulting chain reaction.
Function
maximumDetonation(bombs: int[][]) → intExamples
Example 1
bombs = [[2,1,3],[6,1,4]]return = 2The second bomb reaches the first because their centers are 4 units apart and its radius is 4. Starting from the second bomb detonates both.
Example 2
bombs = [[1,1,5],[10,10,5]]return = 1Neither bomb's radius reaches the other, so any chain contains only its starting bomb.
Example 3
bombs = [[1,1,3],[4,1,3],[7,1,3],[10,1,1]]return = 4Starting from the first bomb triggers the next bomb at distance 3, and the reaction continues through all four bombs.
Constraints
1 <= bombs.length <= 100.- Every entry in
bombshas exactly three integers. 1 <= x, y, radius <= 100000.
More Airbnb Phone Screen questions
- Merge Event PreferencesPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Run-Length Encoding and DecodingPHONE SCREEN · Seen Nov 2026
- Read Across Sound TracksPHONE SCREEN · Seen Nov 2026
- Text JustificationPHONE SCREEN · Seen Nov 2026
- Decode and Store StringsPHONE SCREEN · Seen Oct 2026
- Print Sentences as TablePHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
- Smallest Common RegionPHONE SCREEN · Seen Aug 2026
- Longest Chain BookingPHONE SCREEN · Seen Aug 2026
- Nested List Iterator with RemovePHONE SCREEN · Seen Jul 2026
- Parse Query StringPHONE SCREEN · Seen May 2026
Similar questions at other companies
- Count Islands in a Binary GridApple · PHONE SCREENApple interview questions
- Pacific Atlantic Water FlowAnduril · PHONE SCREENAnduril interview questions
- Count Connected Point ClustersGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
- Maximum Damage PatchGecko Robotics · OA · PHONE SCREEN
- Maximum Area of IslandSkydio · PHONE SCREENSkydio interview questions
- Island Count and Maximum AreaOracle · ONSITE INTERVIEWOracle interview questions
- Max Area of IslandGoldman Sachs · ONSITE INTERVIEWGoldman Sachs interview questions
- Max Area of IslandRoku · ONSITE INTERVIEWRoku interview questions
- Max Area of IslandBloomberg LP · ONSITE INTERVIEWBloomberg LP interview questions
- Maximum Area of IslandSambaNova Systems · ONSITE INTERVIEWSambaNova Systems interview questions
Airbnb interview experiences
- Airbnb OA · November 2026
- Airbnb Campus and Full-Time SWE OA / Interviews: 9 Experiences
- Airbnb Intern Phone Interviews: 21 Experiences (Part 7 of 7)
- Airbnb Intern OA and Phone Screens: 17 Experiences (Part 6 of 7)
- Airbnb Intern OA and Onsite Rounds: 16 Experiences (Part 5 of 7)
- Airbnb Intern OA, Diplomacy Game: 19 Experiences (Part 4 of 7)