Not able to apply recursion
where my code is going wrong?
hi @anubhavb11 i think the problem is that you are changing the value of n, but op < n/2 is a crucial statement for inserting brackets.
Also, the condition for opening brackets should be op < n/2 not op <= n/2 because if n/2 opening brackets are already there you can insert more.
Corrected code: https://ide.codingblocks.com/s/320299
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.