Valid Parentheses Check Problem

Valid Parentheses Check Problem — ExecCode Easy DSA Practice

Solve the Valid Parentheses Check problem on ExecCode. Free online easy DSA practice in Stack. 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 True. Input {"s": "()[]{}"}; Output True. Input {"s": "(]"}; Output False

Constraints

1 <= s.length <= 10^4 s consists of parentheses only '()[]{}'.

Practice Valid Parentheses Check free on ExecCode. Browse DSA problems, topic map, and placement guides.