← 返回 bloomberg 的题目列表Valid Parentheses
类型:online_judge
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if brackets are closed in the correct order. Implement a function is_valid_parentheses(s: str) -> bool to verify, and consider optimizations and runtime. The input limit is up to 10^4. Provide complete test cases.
Example
Input
()