Given a string s containing only the characters ()[]{}, determine if it is valid: brackets must close in the correct order and every opening bracket has a matching closing bracket of the same type.
Input: one line s.
Output: true or false.
()[]{}true
(]
false
Run your code against the sample tests, or Submit to run the full suite.