PrintPermutation Wrong Ouput


This is my code. Why output is wrong here? Where is the mistake?

see the symbol “–>” to for changes

for(int i=0;i<ques.length();i++) {
char ch =ques.charAt(i); ----->
String roq=ques.substring(0,i) + ques.substring(i+1);
printPermutation(roq,ch + ans);
}

we have to choose the ith character from ques string

hope this will help u
pls rate my work so that i can improve my work

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.