Brackets All over

Can i know the dp approach

@Faizan-Ali-1395131367301898 hey first try use recursion ,use set and take character ‘(’ and ‘)’ and concatenate with current string at different positions and call recursion.Here is code for reference.

can u please tell me the role of temp and stack in the program

I understood entire code, but i didn’t understand (temp+1)*xin code

@Faizan-Ali-1395131367301898 hey,you have to tell combinations so for that (temp+1) *x is taken,temp me difference hai elements ka x me size to dono ka multiplication hme no of combinations dega.

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.