6
0
:0
0
Program Block Verify
Program Block Verify
Medium
Stack
In "Program Block Verify", 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:
trueFor input s = "([{}])", Each opening bracket is closed by the correct type in the correct order, so the result is true. Therefore, return true.
Example 2
Input:
s = "(((())))"Output:
trueFor input s = "(((())))", Each opening bracket is closed by the correct type in the correct order, so the result is true. Therefore, return true.
Constraints
1 <= s.length <= 104s contains only ()[]{} characters.
solution.js
Loading...
Test Cases (2)
Test Case 1
Input:
"([{}])"Expected Output:
trueTest Case 2
Input:
"(((())))"Expected Output:
true