Bracket Matcher

0

0 votes
Medium
Problem

Given an expression string exp , write a program to examine whether the pairs and the orders of “{“,”}”,”(“,”)”,”[“,”]” are correct in exp.

Examples:
[()]{}{()()} : true
[(]) : false

Sample Input
[()]{}{[()()]()}
Sample Output
true
Time Limit: 4
Memory Limit: 256
Source Limit:
Explanation

For each type of opening bracket there exits a closing bracket of the same type.

Editor Image

?