Generate paranthesis


i cannot figure out why my code gives no output
Can you comment out the errors?

Also in this question we have to print it in the increasing order, so does that mean in the base case we have to sort the output array and pass a comparator which checks the condition opening bracket>closing bracket??

Hello @mkidwai74 i have corrected your code and commented the mistake:


it is giving the correct input and passing all the test cases.
Happy Learning!!

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.