[LintCode] Valid Parentheses