package
0.0.0-20241209140624-9fce2a725d55
Repository: https://github.com/elven9/my-leetcode.git
Documentation: pkg.go.dev

# README

Longest Valid Parentheses

Solution IdxTime ComplexitySpace ComplexityComment
1O(n^2)O(n)DP solution
2O(n^2)O(n)DP

Sol1 DP: length of the longest valid (well-formed) parentheses substring in s[0:i] Sol2 DP: length of the longest valid (well-formed) parentheses substring end at s[i]

Solution IdxTime ComplexitySpace ComplexityComment
3O(n)O(n)stack based solution