← 返回 openai 的题目列表Valid Parentheses with Redundancy Check
类型:online_judge
Given a string, determine if the parentheses are valid and contain no redundant pairs. For example, in the string ((a-d) + ((b+c))), the (b+c) section has an unnecessary outer pair of parentheses and should return False. Write a function to achieve this and provide test cases.
Example
Input
((a-d) + ((b+c)))