Skip to content

Longest valid parentheses #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2021
Merged

Longest valid parentheses #128

merged 2 commits into from
Apr 10, 2021

Conversation

vbrazo
Copy link
Owner

@vbrazo vbrazo commented Apr 4, 2021

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.

# Example 1:
# Input: s = "(()"
# Output: 2
# Explanation: The longest valid parentheses substring is "()".
# 
# Example 2:
# Input: s = ")()())"
# Output: 4
# Explanation: The longest valid parentheses substring is "()()".
# 
# Example 3:
# Input: s = ""
# Output: 0

@vbrazo vbrazo merged commit 7778396 into main Apr 10, 2021
@vbrazo vbrazo deleted the longest-valid-parantheses branch April 10, 2021 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant