What is the max no of strings I can store in an array of strings, as max length required for this question is (25!) ?
#include<bits/stdc++.h>
using namespace std;
void perDict(string in, int i, string ori){
if(in[i]==’\0’){
if(in.compare(ori)>0)
cout<<in<<"\n";
return;
}
for(int j=i; in[j]!='\0'; j++){
swap(in[i], in[j]);
perDict(in, i+1, ori);
swap(in[i], in[j]);
}
return;
}
int main() {
string in;
cin>>in;
string ori = in;
sort(in.begin(), in.end());
perDict(in, 0, ori);
return 0;
}