验证大小中括号是否成对闭合匹配
Valid Parentheses
- 验证大小中括号是否成对闭合匹配。
- Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.
- The brackets must close in the correct order, “()” and “()[]{}” are all valid but “(]” and “([)]” are not..
example 1
input: '{
{()}}'
output: True
example 2
input: '(([)])'
output: False
example 3