How to calculate the count of all possible balanced brackets?

How to calculate the count of all possible balanced brackets? eg: For
n=3, ans will be 5

@girishgargcool in the recursive function, you can have a count variable passed as reference variable. Update its value in the base case. This way when the recursive function is over, count will have the number of possible combinations of balanced brackets. If you have any confusions regarding the implementation, you can share the code you wrote for generating brackets, I can make modifications in it.

Please mark the doubt as resolved in case of no further queries.

Is it possible to derive a formula?

hi @girishgargcool you can try putting in the values of first few numbers and try to find a sequence on OEIS

What do mean by OEIS?

@girishgargcool http://oeis.org/ you can search for the sequence in the search bar.

hi @girishgargcool the number is given by Catalan number series.

Please mark the doubt as resolved in case of no further queries.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.