You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Maximum Rectangular Area in a Histogram](https://practice.geeksforgeeks.org/problems/maximum-rectangular-area-in-a-histogram-1587115620/1"view question") - [Cpp Solution](./solutions/Maximum%20Rectangular%20Area%20in%20a%20Histogram.cpp)
Given a string S consisting only of opening and closing parenthesis 'ie '(' and ')', find out the length of the longest valid(well-formed) parentheses substring.
6
+
NOTE: Length of smallest the valid substring ( ) is 2.
7
+
8
+
Example 1:
9
+
Input: S = "(()("
10
+
Output: 2
11
+
Explanation: The longest valid
12
+
substring is "()". Length = 2.
13
+
14
+
Example 2:
15
+
Input: S = "()(())("
16
+
Output: 6
17
+
Explanation: The longest valid
18
+
substring is "()(())". Length = 6.
19
+
20
+
Your Task:
21
+
You dont need to read input or print anything. Complete the function findMaxLen() which takes S as input parameter and returns the maxlength.
0 commit comments