Code for problem "Longest Valid Parentheses".