Loading...
Loading...
Loading...
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if:
Input: Bracket-only string s.
Output: Boolean.
Input: s = "()" → Output: true
Input: s = "()[]{}" → Output: true
Input: s = "(]" → Output: false
{')':'(', ']':'[', '}':'{'} for clean code.1 <= s.length <= 10^4
s consists of parentheses only '()[]{}'