Problem
Given a string s made only of the characters ()[]{}, return true if every bracket is **closed by the same type of bracket, in the right order**. An opening bracket must be closed before any bracket opened earlier is closed.
Example 1
- Input
- "()[]{}"
- Output
- true
Example 2
- Input
- "{[]}"
- Output
- true
Example 3
- Input
- "([)]"
- Output
- false
- Why
- ] closes while ( is still the latest open
Constraints
0 <= s.length <= 10^4s contains only the characters ()[]{}.An empty string counts as valid.