NexCode
ProblemsSubmissions
HA
Problems
Connecting

20. Valid Parentheses

Easy
StringStack

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

An input string is valid if open brackets are closed by the same type of bracket, in the correct order, and every close bracket has a matching open bracket.

Input

s = "()"

Expected

true