Generate Parentheses : Wrong answer

I am getting right answers for the given testcase.
Please check the code.

pls send the code ide link

Approach:

initialize the count of open and close bracket to 0 .

Recursively call the generateParenthesis() function until open bracket count is less than the given n.

If open bracket count becomes more than the close bracket count, then put a closing bracket and recursively call for the remaining brackets.

If open bracket count is less than n, then put an opening bracket and call _printParenthesis() for the remaining brackets.

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.