Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 341 Bytes

File metadata and controls

13 lines (10 loc) · 341 Bytes

Problem 14: Maximum Balanced Span (Longest Valid Parentheses)

Problem Statement

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

Input Format

  • A string s.

Example

Input: s = "(()"
Output: 2 Input: s = ")()())"
Output: 4