I'm completely blank on this

How to approach via dp

In this problem your concern should only be the unbalanced brackets in the string and you have to take into account brackets to be added before string, brackets to be added after the given string and what type of bracket to be added.
Hence you get 3 states to handle which makes it 3D Dynamic Programming.
Give it a try

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.