LeetCode Tutorial 20. Valid Parentheses

preview_player
Показать описание
GoodTecher LeetCode Tutorial 20. Valid Parentheses (Java).

LeetCode Tutorial by GoodTecher. The tutorial provides a step-by-step demonstration on how to solve coding problems.

Complete Playlist for the GoodTecher LeetCode Tutorial:

GoodTecher Website:

GoodTecher Channel on YouTube:

GoodTecher Github:
Рекомендации по теме
Комментарии
Автор

Thank you, I like you teaching style.

nehaparmar
Автор

wow you're the best so clear so elegant and easy to understand I'm absolutely amazed

dantewhite
Автор

thank you for the clear explanation. One suggestion: it might be better if you could talk about the time and space complexity:)

willwang
Автор

you can use if(stack.isEmpty || stack.pop != ch) to determine if all characters will be matched of not. and for ch you can use like if we ch == '(' then we push ) into stack, and if we are not able to found ) in the array, then, stack.pop !=c, then it is not matched. and you dont have to write another function tho.

alexhong
Автор

This is a very common interview question. I got this in an interview a few years ago and had to solve it in JavaScript instead of Java. Also do you know if there is any way to solve this using only O(1) space complexity? The stack solution will have O(n) time and O(n) space

Garensonic