Longest Valid Parentheses Python Solution - LeetCode #32

preview_player
Показать описание
This is the Python solution to Longest Valid Parentheses LeetCode problem.

#python #leetcode #coding #programming #algorithm #datastructures #techtutorial #codetutorial #problemsolving #softwaredevelopment #computerscience #codesnippet #programmingtips #codechallenge #technicalinterview #algorithmdesign #softwareengineering #learnprogramming #codingcommunity #codewalkthrough
Рекомендации по теме
Комментарии
Автор

Why is stack initialized with -1? You are not explaining it anywhere.
Also, even though the solution is elegant, it has no explanation, other than the 'we will use the stack, then increment this, and subtract that...', which is the resulting code and not the train of though leading to it.

igorku
Автор

how are you dealing with the case "()()"?

nakasan
Автор

thank you so much for saving my time dude

VIKHASHJP-sj
welcome to shbcf.ru