Home
Topics
Practice
Roadmap
DSA Tracker
Code Editor
Tech Blogs
More
Sign in
Get started
Loading question...
Feedback
Valid Parentheses
Medium
00:00
0 users online
Share
Description
Solution
Submissions
Discussion
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
Sample Input:
"()[]{}"
Sample Output:
true
Hints
Hint 1
Use a stack to keep track of opening brackets
Hint 2
When encountering a closing bracket, check if it matches the top of the stack
Hint 3
The string is valid if the stack is empty at the end
Code Editor
Reset
Run
Save
Loading...