MINIMUM ADD TO MAKE PARENTHESIS VALID | PYTHON | LEETCODE # 921

  Рет қаралды 5,660

Cracking FAANG

Cracking FAANG

Күн бұрын

Пікірлер: 10
@superanshul
@superanshul 2 ай бұрын
Very helpful channel, I come here often. Want to highlight a small mistake in visual explanation at 4:35, we should increment right count only if we have an extra available left open parenthesis for it. This means increment right only if l_count > r_count. In your explanation at 4:35 you have it the other way round. I see you didn't make the same mistake in code though, and therefore code got submitted.
@uniforcestelian7917
@uniforcestelian7917 2 жыл бұрын
This channel is extremely helpful for understanding how to approach LC medium to hard lvl problems. Thanks and I hope you continue to upload these helpful videos.
@weeno4331
@weeno4331 9 ай бұрын
this can also be done more cleanly IMO using a stack, but it would use O(n) space complexity vs this one that uses O(1)
@provarence7361
@provarence7361 Ай бұрын
I agree stack makes much more sense but may be non optimal
@jaleelpasha3301
@jaleelpasha3301 8 ай бұрын
Why not just reduce the lcount, if it is greater than 0 when we encounter right parentheses?
@shreyashzanjal3729
@shreyashzanjal3729 8 ай бұрын
🎯 Key Takeaways for quick navigation: Greedy left tracking Balanced parentheses count Iterative string processing Made with HARPA AI
@sreejitchatterjee4438
@sreejitchatterjee4438 2 жыл бұрын
Hey could you please link the video of the minimum remove parentheses? I couldn't find it on your channel
@crackfaang
@crackfaang 2 жыл бұрын
I’m on mobile and can’t link but in case you haven’t found it yet search for “facebooks #1 interview question” on my channel and you should find it. I think I named it “min. remove” instead of “minimum remove” to save space in the title
@hjlee3124
@hjlee3124 2 жыл бұрын
great explanation!!
@crackfaang
@crackfaang 2 жыл бұрын
Glad you liked it!
MINIMUM TIME DIFFERENCE | PYTHON | LEETCODE # 539
8:45
Cracking FAANG
Рет қаралды 4,1 М.
Молодой боец приземлил легенду!
01:02
МИНУС БАЛЛ
Рет қаралды 1,9 МЛН
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 3,5 МЛН
Players push long pins through a cardboard box attempting to pop the balloon!
00:31
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 111 МЛН
BASIC CALCULATOR II | LEETCODE 227 | PYTHON SOLUTION
15:40
Cracking FAANG
Рет қаралды 24 М.
Minimum Add to Make Parentheses Valid - Leetcode 921 - Python
7:29
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 148 М.
I solved 541 Leetcode problems. But you need only 150.
7:42
Sahil & Sarra
Рет қаралды 2,4 МЛН
ACCOUNTS MERGE | LEETCODE # 721 | PYTHON SOLUTION
23:04
Cracking FAANG
Рет қаралды 12 М.
LOWEST COMMON ANCESTOR OF A BINARY TREE III [PYTHON]
16:38
Cracking FAANG
Рет қаралды 12 М.
Молодой боец приземлил легенду!
01:02
МИНУС БАЛЛ
Рет қаралды 1,9 МЛН