Given a string s containing only the characters (, ), {, }, [, and ], determine if the input string is valid.
A string is valid if:
An empty string is considered valid.
s = "()"trues = "()[]{}"trues = "(]"falses = "([)]"falses = "{[]}"true0 <= s.length <= 10^4s consists only of characters ()[]{}Run your code to see results
Use Cmd+Enter to run