Leetcode problem no 22 balanced parenthsis

this is the link of the leetcode problem —https://leetcode.com/problems/generate-parentheses/---
and this the link of my solution , my solution is not generating output can u please make corrections in the solution—
https://ide.geeksforgeeks.org/pv8EVWgcQD

@AbhishekAhlawat1102
in the base case your returning arraylist with only one element whose size is equal to zero so you can’t iterate over that string add parenthesis.

@AbhishekAhlawat1102
and if your permutate then it will not give unique result.

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.