Sir, i am getting WA in 8 test cases out of 9, I have sorted them and then permuted accordingly, can you point out where i am lacking ?
Wrong answer In 8/10 test cases
use next_permutation, it is already in standard library.
#include<bits/stdc++.h>
using namespace std;
int main()
{
{
string s;
cin>>s;
sort(s.begin(), s.end());
cout<<s<<’\n’;
while(next_permutation(s.begin(), s.end())){
cout<<s<<’\n’;
}
}
}
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.