Given an expression exp of length n consisting of some brackets. The task is to print the bracket numbers when the expression is being parsed.
Examples :
Input : (a+(b*c))+(d/e)
Output : 1 2 2 1 3 3
The highlighted brackets in the given expression
(a+(b*c))+(d/e) has been assigned the numbers as:
1 2 2 1 3 3.
Input : ((())(()))
Output : 1 2 3 3 2 4 5 5 4 1
Print Bracket Number : https://www.geeksforgeeks.org/print-bracket-number/