Showing wrong answer in test cases

#include
using namespace std;
void brackets2(char *arr,int n)
{

if(n==0 || n<0)
{
	return;
}

	for(int k=0;arr[k]!='\0';k++)
	{
		cout<<arr[k];
	}
	brackets2(arr,n-1);

}

void brackets(char *arr,int n)
{

if(n==0)
{ cout<<"";
	return;
}
    
    cout<<"(";
	brackets(arr,n-1);
	cout<<")";

}
int main() {
char arr[2]={’(’,’)’};
int n;
cin>>n;
brackets2(arr,n);
cout<<endl;
if(n>3)
{
for(int i=2;i<n;i++)
{ for(int q=1;q<i;q++)
cout<<"(";
brackets2(arr,n-i+1);
for(int q=1;q<i;q++)
cout<<")";
cout<<endl;

}
}
if(n>1)
brackets(arr,n);
return 0;

}

for n=11 , the output is of 1160 lines , there are 1160 combinations satisfying the conditions, but your code is printing only 11 lines of output. check it , make more cases

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.