Getting error in this

#include
#include
#include
using namespace std;
void fun(int a[],int i,set &s){
if(a[i]==’\0’){
string t(a);
s.insert(t);
return;
}
for(int j=i;a[j]!=’\0’;j++){
swap(a[i],a[j]);
fun(a,i+1,s);
swap(a[i],a[j]);
}
}
int main() {
int n,
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}

set<string> s;
fun(a,0,s);
for(auto x:s){
	for(auto y:x){
		cout<<y<<" ";
	}
	cout<<endl;
}
return 0;

}

hello @mansi25
could you please share the hackerblocks link of this question .
so that i can try to submit .
i am unable to find this question on hackerblocks

https://online.codingblocks.com/app/player/163443/content/165259/5147/code-challenge

hey @mansi25 this link is not working

please share the hackerblocks link .

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.