Welcome to LeetCode Discuss.
This is a place to ask questions related to only OJ problems.
Please read the FAQ to help yourself making the best use of Discuss.
In this question
In the description input )()()) output is 4
while in OJ input ()(() output is 2
However there are 4 length balance parenthesis in ()(().
Could some one explain the reason/difference between these two format.
Thanks in advance.
This question asks for substring instead of subsequence. ()() is a subsequence of ()(() not a substring while () is the longest balanced parenthesis substring for ()(()
Thanks , I overlooked that point.