DETONATE THE MAXIMUM BOMBS | LEETCODE 2101 | PYTHON GRAPH SOLUTION

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

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.
@cindysu262
@cindysu262 Жыл бұрын
Thank you the the video. Can you please do LC1105 as well. TY
@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.
@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!
UNIQUE NUMBER OF OCCURENCES | LEETCODE 1207 | PYTHON SOLUTION
10:31
Cracking FAANG
Рет қаралды 1,1 М.
INSERT INTO CIRCULAR LINKED LIST | LEETCODE # 708 | PYTHON SOLUTION
15:25
Comfortable 🤣 #comedy #funny
00:34
Micky Makeover
Рет қаралды 11 МЛН
Они так быстро убрались!
01:00
Аришнев
Рет қаралды 2,4 МЛН
Alex hid in the closet #shorts
00:14
Mihdens
Рет қаралды 19 МЛН
Detonate the Maximum Bombs - Leetcode 2101 - Python
11:20
NeetCodeIO
Рет қаралды 12 М.
STOCK PRICE FLUCTUATION | LEETCODE # 2034 | PYTHON HEAP SOLUTION
18:44
Cracking FAANG
Рет қаралды 2,6 М.
LOWEST COMMON ANCESTOR OF A BINARY TREE II | PYTHON | LEETCODE 1644
20:46
REMOVE DUPLICATE LETTERS | LEETCODE 316 | PYTHON STACK SOLUTION
18:15
Cracking FAANG
Рет қаралды 1,7 М.
CONTAINER WITH MOST WATER | LEETCODE # 11 | PYTHON 2 POINTERS SOLUTION
11:11
How I Would Learn To Code (If I Could Start Over)
13:43
Namanh Kapur
Рет қаралды 7 МЛН
LOWEST COMMON ANCESTOR OF A BINARY TREE I | PYTHON | LEETCODE 236
12:48
JPEG is Dying - And that's a bad thing
8:09
2kliksphilip
Рет қаралды 166 М.
Ba Travel Smart Phone Charger
0:42
Tech Official
Рет қаралды 1,2 МЛН
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 1,1 МЛН
Опасность фирменной зарядки Apple
0:57
SuperCrastan
Рет қаралды 12 МЛН