Why isn't it passing?

#include<bits/stdc++.h>
using namespace std;

int getAllSubS(string s, string* output){
if(s[0]==’\0’){
output[0]=s[0];
return 1;
}
int lenSmall=getAllSubS(s.substr(1),output);
for(int i=0;i<lenSmall;i++){
output[lenSmall+i]=s[0]+output[i];
}
return 2*lenSmall;
}

bool mysort(string a,string b){
return a<b;
}

int main(){
int t;
cin>>t;
while(t–){
string s;
cin>>s;
int n=2;
for(int i=0;i<s.length();i++){
n=n*2;
}
string output[n];
int count=getAllSubS(s,output);
sort(output,output+count,mysort);
for(int i=0;i<count;i++){
cout<<output[i]<<endl;
}
}
return 0;
}

hi @nakshjain refer