Where is wrong in my logic

#include
#include
#include<unordered_map>
using namespace std;
int count=0;
unordered_map<string,int>mp;

int recur(int j,int n,string ai,string str){
if(j==n){

     return 0;
     
 }
   if(mp[ai]!=0){
	   return 0;
   }
   

	int t= recur(j+1,n,ai,str)+recur(j+1,n,ai+str[j],str)+1;

   mp[ai]=t;
   
   
   return t;

}
int main()
{
int q;
cin>>q;
for(int u=0;u<q;u++){
string str;
cin>>str;
int n=str.length();
int i=n;
string ai =" “;
cout<<recur(0,n,ai,str);
cout<<”\n";

mp.clear();}
return 0;

}

hello @dineshjani

pls explain this line .

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.