My code passes all other test cases but gives an Run Error for the third Test Case. I am not sure what am I doing wring here.
Here is my Code: https://ide.codingblocks.com/s/299110
My code passes all other test cases but gives an Run Error for the third Test Case. I am not sure what am I doing wring here.
Here is my Code: https://ide.codingblocks.com/s/299110
your code is giving run time error for input
qwertyuio
correct way to use next_permutation function
int main() {
string str;
getline(cin, str);
while(next_permutation(str.begin(),str.end())){
cout<<str<<endl;
}
return 0;
}
if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like
: and don’t forgot to mark doubt as resolved 
I am not sure why am I getting a run error. Also can we solve this problem through recursion ? If so, can you help me with the approach we should use ?
may be you are getting runtime error because of excessive recursive call because every time new memory will be allocated to function
iterative methods are always better than recursive one
use iterative method (the code which i provide)
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.