Given a string s containing only the characters (, ), {, }, [, and ], return True if the string is valid.
A string is valid if:
Input: s = "()" Output: True Explanation: A single matched pair, valid.
Input: s = "()[]{}"
Output: True
Explanation: Three separate matched pairs in sequence, valid.
Input: s = "(]" Output: False Explanation: The closing bracket ] does not match the opening bracket (.
Input: s = "([)]" Output: False Explanation: The brackets are interleaved incorrectly; [ is closed by ) before ] closes it.
s consists of (, ), {, }, [, ] only.s = "()"