contset

[Solved] Pairing the brackets Contest Problem

[Solved] Pairing the brackets Contest Problem

We are given bracket sequence(may not be balanced). Every character of the sequence is either ‘(‘ or ‘)’.  For each closing bracket, we need to find an opening bracket which is farthest from it (and on left of it) and pair those two brackets.Once…