The Depth Check

5

1 votes
Easy
Problem

Abhisek sets off on a quest named the "The Depth Check". His only question - How deep is it?

Input:

An string of characters consisting of alphabets and parentheses.

Input constraints:

1) Input string can be of length 1 to 100.
2) The input will have only ‘(‘ , ‘)’ and letters from English alphabet.
3) There will be no repetition of letters.
4) Only lowercase letters are used.
5) The letters can be in any sequence.
6) The parentheses are always well balanced. Every '(' has a matching ')' that follows it later in the string. Every ')' has a matching '(' before it in the input string.
7) Notice that there are no space in the string.

Output:

1) The depth of each letter separated by a space.
2) The order of the depth of the letters should be the same order in which the letters appear in the input.
3)To mark the end of the output it should end with a space and a ‘#’ character.

Time Limit: 0.11
Memory Limit: 256
Source Limit:
Editor Image

?