Skip to content
6
0
:
0
0

Bracket Stream Validator: Template Parser Edition

Easy

Stack

In "Bracket Stream Validator: Template Parser Edition", you receive a string containing only bracket characters.

Determine whether every opening bracket is closed by the correct type and in the correct order.

Example 1

Input:s = "([)]"
Output:false

For input s = "([)]", A bracket type or closing order mismatch occurs, so the result is false. Therefore, return false.

Example 2

Input:s = "{[}]"
Output:false

For input s = "{[}]", A bracket type or closing order mismatch occurs, so the result is false. Therefore, return false.

Constraints

  • 1 <= s.length <= 104
  • s contains only ()[]{} characters.
solution.js
Loading...

Test Cases (2)

Test Case 1
Input:
"([)]"
Expected Output:
false
Test Case 2
Input:
"{[}]"
Expected Output:
false