Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if:
s = "()"trues = "()[]{}"trues = "(]"false1 <= s.length <= 10^4s consists of parentheses only: '()[]{}'Expected time complexity: O(n)Run your code to see results
Use Cmd+Enter to run