Problem Solving Skills for LeetCode

preview_player
Показать описание


#coding #leetcode #python
Рекомендации по теме
Комментарии
Автор

This is so so great that you are putting out shorts! This is the quickest one can revise. You are incredible and innovative.

aparnachand
Автор

These shorts are amazing. Keep them coming! You are helping us all remain mentally alert.

abhirama
Автор

Thank you for these vids neetcode, I had a problem similar to this recently and having watched this video really helped. Thank you for saving YouTube shorts brainrot, I make sure to always watch these videos all the way through when they pop up

Joeybamsandmore
Автор

I am loving these shorts, and when they’re ones I have done before it’s 😻😻

noextrasugar
Автор

I don't have time to play these games with programming, but I do enjoy the content. I also enjoy code editors that highlight the matching parentheses.

javabeanz
Автор

Good solution :) you essentially just explained the utility of a Push-Down Automaton in a scenario like this without letting the message get obscured to beginners by the heavy-handed jargon that would otherwise naturally come with Theory of Computation concepts like automata.

Lin_The_Cat_
Автор

I believe Map[c] would be close_to_open[c]

n.h.son
Автор

Very simple and elegant solutions. thank you :o

pwc
Автор

keep a stack of open parentheses. see an opening one, add it to the stack. see a closing one, pop the top off the stack and check if it's the opening counterpart to the closing one you are seeing. if it's not, or if the stack is empty, return False. if you get through the whole string and the stack is empty by the end, return True. if there are still some values on the stack, return false.

bilbo_gamers
Автор

I have seen this problem before, ended up writing array fuckery I didn’t know the data structure yet at the time

jumpjump-ozpr
Автор

For more context, this is Dyck language which can be represented by context-free grammar which can be transformed into push down automata (which might inspire the solution for this problem).

GK-ddci
Автор

The code should be changed fromMap[c] to close_to_open[c]
As there is nothing like Map defined in the code. Kindly change it.

mervinjarvis
Автор

For the close_to_open dictionary, why couldn’t you have done open to close?

dvilscry
Автор

Quick correction: The singular of parentheses is parenthesis, the pronunciations are identical.

hassan_codes
Автор

Why test 99( where s = "[([]])" )
Output is true?

_Danonik_
Автор

This sounds like George Polya "How to solve it"

sp
Автор

is there a way to connect with you as i have some doubts regarding data structures and algorithms

notmidhun
Автор

I feel like theres a cool recursive solution but I cant come up with it

juhanakaarlehto
Автор

I would have just gone through each and every parentheses manually

WeirdInfoTV
Автор

Or we could split it at (), [], {} for len(s)/2 times. At the end if we have an empty string left then its valid, else invalid. What would be the time complexity for this tho?

wanderer