really solve the validParentheses