This was asked to me in an interview. I didn't know the proper recurrence for it at that time. The question was, if I am given the length of the expression, then how many proper bracket expressions can be made of that length and what will they be?
A proper bracket expression is for example,
[[]][[[]][]]
[[[][]]][][[]]
The following is not a proper bracket expression,
[[[][]]][]][[]]
That is, there is a closing bracket for each opening bracket. I am not looking for the implementation, but just the algorithm or how should I approach it?
Thanks!