Validate Stack Sequences | Live Coding with Explanation | Leetcode - 946

preview_player
Показать описание
This video explains the greedy approach to solve the question using a Stack.

To support us you can donate

Check out our other popular playlists:

If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful.

#coding #leetcode #programminglife #programmingisfun #programmer #tech #software #codinglife #leetcode
Рекомендации по теме
Комментарии
Автор

We hope you all are enjoying our videos!!! Don't forget to leave a comment!!! Please like the video to support us!!!

Questions you might like:

Struggling in a question??

Leave in a comment and we will make a video!!!🙂🙂🙂

AlgorithmsMadeEasy
Автор

beautiful solution and so easy to understand. thank you so much!

moezzzz
Автор

Solution will be 97% faster solution
In the end Replace ->
return st.empty()
to
return j == popped.length

nikhilsisodia
Автор

Good approach. I believe we could have an O(1) space solution using an additional pointer for tracking the pushed array values instead of the extra space of the Stack. The logic won't change too much, tho. I love this channel, thanks for your work guys.

pubamx
welcome to shbcf.ru