cheetcode

21. Valid ParenthesesEasy

Determine whether brackets are closed in the correct order.

Given a string containing bracket characters, determine if every opening bracket is closed by the same type of bracket.

Examples

Input: s = "()[]{}"
Output: true
Input: s = "(]"
Output: false
Input: s = "{[]}"
Output: true

Constraints

  • 1 <= s.length <= 10,000
  • s contains only bracket characters.