You have unread notifications. Click here.

Stack 2

Loading ...
Start CodingShow Advanced ExercisesShow Problem Solving

Problem Solving

Problem statement 

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

Cases:

()( -> Not Valid

() -> Valid

([]) -> Valid

( ->Not Valid

Input

1 <= s.length <= 10^4

s consists of parentheses only '()[]{}'.

Output

print true if the string is valid, otherwise print false.


Back to Course