DETONATE THE MAXIMUM BOMBS | LEETCODE 2101 | PYTHON GRAPH SOLUTION

  Рет қаралды 1,939

Cracking FAANG

Cracking FAANG

Күн бұрын

Problem Link: leetcode.com/problems/detonat...
Discord Link: / discord
In this video we are solving another Google interview question: Detonate the Maximum Number of Bombs (Leetcode 2101). I hope this video doesn't get my channel taken down for saying "detonate bomb" enough times...
This question seems like it might be a hard DP question but it's actually surprisingly a graph question. And quite an intuitive one at that.
TIMESTAMPS:
00:00 Intro
00:18 Question Prompt
01:11 Basic Example
02:23 Solution Intuition
04:24 Coding
09:15 Time/Space Complexity
10:45 Outro

Пікірлер: 6
@AshaYalla
@AshaYalla Жыл бұрын
wow. love your dedication of uploading a new problem every day. thanks a lot.
@jedholtman9075
@jedholtman9075 Жыл бұрын
Shouldn't line 28 be T: O(N^2) + O(N^2) -> O(N^2) ? In the worst case we have a fully connected graph built, so we run a N-runtime DFS N total times.
@cindysu262
@cindysu262 Жыл бұрын
Thank you the the video. Can you please do LC1105 as well. TY
@annalisa_m
@annalisa_m Жыл бұрын
Actually what you say at 1:20 is not correct, you say that because the circles overlap then any of them would detonate the other. However it is not enough that the circle overlap, but the circle has to include the other point in order to detonate it. The example is explained in the problem description: Input: bombs = [[2,1,3],[6,1,4]] Output: 2 Explanation: The above figure shows the positions and ranges of the 2 bombs. If we detonate the left bomb, the right bomb will not be affected. But if we detonate the right bomb, both bombs will be detonated. So the maximum bombs that can be detonated is max(1, 2) = 2.
@crackfaang
@crackfaang Жыл бұрын
Yea I misspoke, the solution is based on the radius though
@annalisa_m
@annalisa_m Жыл бұрын
@@crackfaang Thanks, yes the answer is correct, thank you for posting in btw. Just wanted to mention that little details in case ppl might get confused. Keep posting these great videos please! Thank you!
BEST MEETING POINT | LEETCODE 296 | PYTHON OPTIMAL SOLUTION
18:06
Cracking FAANG
Рет қаралды 1,7 М.
Smart Sigma Kid #funny #sigma #comedy
00:40
CRAZY GREAPA
Рет қаралды 33 МЛН
Box jumping challenge, who stepped on the trap? #FunnyFamily #PartyGames
00:31
Family Games Media
Рет қаралды 20 МЛН
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 8 МЛН
LARGEST PALINDROMIC NUMBER | LEETCODE 2384 | PYTHON SOLUTION
14:56
Cracking FAANG
Рет қаралды 1,6 М.
Stop, Intel’s Already Dead!
13:47
Linus Tech Tips
Рет қаралды 547 М.
LONGEST UNIVALUE PATH | LEETCODE 687 | PYTHON DFS SOLUTION
14:46
Cracking FAANG
Рет қаралды 912
K-TH MISSING POSITIVE NUMBER | LEETCODE 1539 | PYTHON SOLUTION
11:00
Cracking FAANG
Рет қаралды 2,5 М.
Meta Product Architecture/Design Interview - Part 1 - Overview
16:30
Cracking FAANG
Рет қаралды 4,3 М.
Nokia 3310 top
0:20
YT 𝒯𝒾𝓂𝓉𝒾𝓀
Рет қаралды 4,4 МЛН
Ba Travel Smart Phone Charger
0:42
Tech Official
Рет қаралды 1,2 МЛН
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 29 МЛН
Как противодействовать FPV дронам
44:34
Стратег Диванного Легиона
Рет қаралды 123 М.
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 3,5 МЛН
low battery 🪫
0:10
dednahype
Рет қаралды 1,8 МЛН