LeetCode
Longest Valid Parentheses
Click
here
for an explanation.