Skip to content

Latest commit

 

History

History

0032.longest-valid-parentheses

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

题目描述

给定一个只包含 '(' 和 ')' 的字符串,找出最长的包含有效括号的子串的长度。

示例 1:

输入: "(()"
输出: 2
解释: 最长有效括号子串为 "()"

示例 2:

输入: ")()())"
输出: 4
解释: 最长有效括号子串为 "()()"

解题思路

具体解法

Golang