Brackets all over

please explain in detail the approach to solve this problem using dp.

Hello @shashakchandel

In this question, you need to answer the number of different combinations of string a & b that can be used to make a + s + b balanced under the constraint that the length of a + s + b should be n.

The statement “At any index, number of opening brackets should be greater than closing brackets” is wrong and should be “At any index, number of opening brackets should be greater or equal to number of closing brackets”

If you still face any problem, leave a reply and I will get back to you.

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.