Given a string `s` of brackets `()[]{}`, determine if the input is valid.
Examples
Input
s = "()"
Output
true
Input
s = "(]"
Output
false
Constraints
- 1 <= s.length <= 10⁴
Given a string `s` of brackets `()[]{}`, determine if the input is valid.
s = "()"
true
s = "(]"
false
Explore step-by-step interactive animations, memory state tracking, and live multi-language execution in DrawCode.
Launch Interactive Visualizer