- Longest Valid Parentheses Add to List
Description Submission Solutions
Total Accepted: 86398
Total Submissions: 374225
Difficulty: Hard
Contributors: Admin
Given a string containing just the characters ‘(‘ and ‘)’, find the length of the longest valid (well-formed) parentheses substring. For “(()”, the longest valid parentheses substring is “()”, which has length = 2.
Another example is “)()())”, where the longest valid parentheses substring is “()()”, which has length = 4.
使用动态规划进行解题