DICTIONARY ORDER(LARGER)

Doesnt pass any test case :frowning:

#include
#include
using namespace std;

bool iscompare(string a,string out){
if(a>out)
return true;
else
return false;
}

void permute(string a,string out, int i){
if(a[i]==’\0’){
if(iscompare(a,out)){
cout<<a<<endl;
}
return;
}
for(int j=i;a[j]!=’\0’;j++){
swap(a[i],a[j]);
permute(a,out,i+1);
swap(a[i],a[j]);
}
}

int main() {
string a;
cin>>a;
string out=a;
permute(a,out,0);
return 0;
}

your submissions show you have scroed 100! good job ! if this solves your doubt please mark it as resolved :slight_smile: