Balanced Parentheses II Problem
Balanced Parentheses II Problem — ExecCode Easy DSA Practice
Solve the Balanced Parentheses II problem on ExecCode. Free online easy DSA practice in Stacks & Queues. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. Your task is to an input string is valid if: 1. Open brackets must be closed by the same type of brackets. 2. Return the required answer exactly as shown in the examples.
Examples
Input {"s": "()"}; Output Yes. Input {"s": "()[]{}"}; Output Yes. Input {"s": "(]"}; Output No
Constraints
1 <= s.length <= 10^4 s consists of parentheses only '()[]{}'.
Practice Balanced Parentheses II free on ExecCode. Browse DSA problems, topic map, and placement guides.