You are given a string s containing only the characters '(', ')', '{', '}', '[', and ']'.
Your task is to determine whether the input string is valid.
A string is considered valid if:
1. Every opening bracket has a corresponding closing bracket of the same type.
2. Brackets are closed in the correct order.
3. No unmatched or improperly nested brackets exist.
Use a stack-based approach to check for validity.
Input: s = "{[()]}"
Output: true
Input: s = "{[(])}"
Output: false
Input: s = "((({[]})))"
Output: true
Accepted:
Submission: