its working on checking but on submittiing its showing testcases error
#include<bits/stdc++.h>
using namespace std;
void generatepair(char arr[],int i,int o,int c,int n){
if(i==2*n){
arr[i]=’\0’;
cout<<arr<<"\n";
return;
}
else if(o<n){
arr[i]=’(’;
generatepair(arr,i+1,o+1,c,n);
}
if(c<o){
arr[i]=’)’;
generatepair(arr,i+1,o,c+1,n);
}
return;
}
int main() {
int n;
cin>>n;
char arr[100];
generatepair(arr,0,0,0,n);
return 0;
}