longest-valid-parentheses

O(n)