Valid Parentheses Parser

Easy
strings Google Meta Amazon

Given a string containing characters '(', ')', '{', '}', '[' and ']', determine if the input string has valid (properly nested and matched) brackets.

Example

is_valid_parens("({[]})")
# => True
is_valid_parens("([)]")
# => False

Test Cases

Python Editor

Output

Click "Run" to see results...