Given a string s containing only the characters '(', ')', '{', '}', '[', ']', determine if the input string is valid.
A string is valid if:
1. Open brackets are closed by the same type of bracket.
2. Open brackets are closed in the correct order.
3. Every close bracket has a corresponding open bracket.
Input: A string s containing only '(', ')', '{', '}', '[', ']'.
Output: Return 'true' if the string is valid, otherwise 'false'.
Input: ()
Output: true
Explanation: Single matching pair → valid.Input: ()[]{}
Output: true
Explanation: Three separate pairs, all matching → valid.Input: (]
Output: false
Explanation: '(' cannot be closed by ']' → invalid.0 <= s.length <= 10^4s consists of '(){}[]' only